I want to replace the first context
web / style / clients.html
using java method String.replaceFirst so that I can get:
$ {pageContext.request.contextPath} /style/clients.html
I tried
String test = "web/style/clients.html".replaceFirst("^.*?/", "hello/");
And it gives me:
hi / style / clients.html
but when i do
String test = "web/style/clients.html".replaceFirst("^.*?/", "${pageContext.request.contextPath}/");
gives me
java.lang.IllegalArgumentException: link to an illegal group
source
share