【发布时间】:2010-04-08 17:35:10
【问题描述】:
我想替换
的第一个上下文web/style/clients.html
使用 java String.replaceFirst 方法,我可以得到:
${pageContext.request.contextPath}/style/clients.html
我试过了
String test = "web/style/clients.html".replaceFirst("^.*?/", "hello/");
这给了我:
你好/style/clients.html
但是当我这样做时
String test = "web/style/clients.html".replaceFirst("^.*?/", "${pageContext.request.contextPath}/");
给我
java.lang.IllegalArgumentException:非法组引用
【问题讨论】: