• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL: How to do string manipulation in EL?

 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to eliminate all scriptlets from my JSP, but I don't see a way to do string manipulation (substring, regexp replace, indexOf) operations from the JSTL Expression Language.
Is there any good way to eliminate these scriptlets from my JSP?
<% String uri = request.getRequestURI();
pageContext.setAttribute("ret", uri.substring(uri.lastIndexOf('/')+1)); %>
and
<th><%= col.getName().replaceAll(" ","<br/>") %></th>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!