没太看懂你的意思。据我的理解,你可不可以这样做:
1、你先将“/UserFiles/Image/00.gif”赋值给一个字符串变量,在jsp页面中写成
<%
   String path="/UserFiles/Image/00.gif";
%>
2、然后,你将页面中的img标签里的src属性内容替换成:
<img height="226" width="140" alt="" src="<%=path %>" />不知道,这样能不能符合你的要求。对于你的说法,我本人就是这样理解的。

解决方案 »

  1.   

    哦,是这样的:
    This is some <strong>sample text</strong>. You are us
    <img height="226" width="140" alt="" src="/UserFiles/Image/00.gif" />ing <a href="http://www.fredck.com/fckeditor/">FCKeditor</a>
    <img height="226" width="140" alt="" src="/UserFiles/Image/12.gif"/>是保存在数据库里的,我想在页面上显示他的前一张图片,所以要做一个类把("/UserFiles/Image/00.gif")提取出来
      

  2.   

    不知道你的这种图片路径多不多,你把这些路径存放到数组里,或是Hashtable里;然后用我上面的方法,用到哪个图片,就把那个图片路径提取出来。你还可以把数组或Hashtable放进session里。这样无论在哪取值都好办
      

  3.   

    String regEx="<img\\s(|[^<>]+\\s)src=(\"?)([^<>\"]+)\\2(|\\s[^<>]*)>";
    String str="This is some <strong>sample text</strong>. You are us<img height=\"226\" width=\"140\" alt=\"\" src=\"/UserFiles/Image/00.gif\" />ing <a href=\"http://www.fredck.com/fckeditor/\">FCKeditor</a><img height=\"226\" width=\"140\" alt=\"\" src=\"/UserFiles/Image/12.gif\"/>";
    Pattern p=Pattern.compile(regEx);
    Matcher m=p.matcher(str);
    while (m.find()) {
    System.out.println(m.group(3));
    }
      

  4.   

    大虾,谢谢你.
    但你还是不明白我的意思,我知道把她放到数组里,但我分离不出来("/UserFiles/Image/00.gif")这段代码.