• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL fn:split -- getting an error message

 
Frank Serkland
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to split a string on the new line character (\n) in a JSP, but I am getting an error message. Here is my code.



Here is my error message.

 
Paul Clapham
Sheriff
Posts: 21892
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm pretty sure you don't need to escape the backslash in \n twice; as far as I can tell (and the tutorials are pretty shoddy) that parameter is a delimiter, not a regex. I'm not even sure if you need to escape the backslash once, but I'd try that first.
 
Frank Serkland
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just tried it with one backslash (\n), and I still got the same error message.
 
Frank Serkland
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have resolved the problem. I was missing the right curly brace. The corrected code now looks like this.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!