没太看懂你的意思。据我的理解,你可不可以这样做:
1、你先将“/UserFiles/Image/00.gif”赋值给一个字符串变量,在jsp页面中写成
<%
String path="/UserFiles/Image/00.gif";
%>
2、然后,你将页面中的img标签里的src属性内容替换成:
<img height="226" width="140" alt="" src="<%=path %>" />不知道,这样能不能符合你的要求。对于你的说法,我本人就是这样理解的。
1、你先将“/UserFiles/Image/00.gif”赋值给一个字符串变量,在jsp页面中写成
<%
String path="/UserFiles/Image/00.gif";
%>
2、然后,你将页面中的img标签里的src属性内容替换成:
<img height="226" width="140" alt="" src="<%=path %>" />不知道,这样能不能符合你的要求。对于你的说法,我本人就是这样理解的。
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")提取出来
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));
}
但你还是不明白我的意思,我知道把她放到数组里,但我分离不出来("/UserFiles/Image/00.gif")这段代码.