http://123.cn/user/down_view.html?id=402881d836bef45b0136bf230f770031在前台
<input type="text" name=""> 输入http://123.cn/user/down_view.html?id=402881d836bef45b0136bf230f770031
在java 获取id 后面的id
 怎么实现的呢?

解决方案 »

  1.   

    StringTokenizer st = new StringTokenizer("http://123.cn/user/down_view.html?id=402881d836bef45b0136bf230f770031","id?");
    String temp[] = new String[st.countTokens()];
    int i = 0;
    while (st.hasMoreTokens()) {
    temp[i] = new String(st.nextToken());
    i++;
    }
    for (int j = 0; j < temp.length; j++) {
    System.out.println(temp[j]);
    }
      

  2.   

    LZ什么意思  是在前台获取ID? 还是在后台取?
      

  3.   

    用string类的两个方法,首先用indexof方法获得“=”号的索引位置index,然后用substring(index),即可获得你要的结果了。
      

  4.   


    是你说的那样-----------------
    1,http://123.cn/user/down_view.html?id=402881d836bef45b0136bf230f770031是用户在前台随便输入的在用java 代码获取input 的name 进行处理怎么实现呢? 大虾帮帮忙。
      

  5.   

    a.seturl(addUrl.substring(0,addUrl.lastIndexOf("=")));
    ------------------
    奇怪了,怎么获取到= 前面的地址了,我想获取=后面面的id值。反了。