doutui9606 2012-11-16 00:14
浏览 1336

用Java解析URL

I am looking for an equivalent to PHP's "parse_url" function in Java. I am not running in Tomcat. I have query strings saved in a database that I'm trying to break apart into individual parameters. I'm working inside of Pentaho, so I only have the Java SE classes to work with. I know I could write a plugin or something, but if I'm going to do all that I'll just write the script in PHP and be done with it.

TLDR: Looking for a Java standard class/function that takes a String and spits out an array of parameters.

Thanks,

Roger

  • 写回答

4条回答 默认 最新

  • duanci6484 2012-11-16 00:17
    关注

    String has a split function, but you will need to write your own regex to determine how to split the string.

    See: http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split(java.lang.String)

    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大