Forums Register Login
Using jstl split function
Is it normal that when I use jstl split on a string like 2,1748,,Steve to have the splitarray[2] be assigned the value of Steve when this is really the value of splitarray[3]? This is sure messing up things when the string to split has a blank value in it.
I've never used that function because I keep my logic completely out of the JSP. If I had to do a split, I would add a method to my model object with methods like model.returnNameOfUser() and implemented as split[3]. Then I can trust Java code - which I can unit test to make sure it behaves as expected.

While the results you are seeing are unintuitive, the fact that nobody has commented either way implies that's how it works or nobody is using this feature/scenario.
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
Why should you try IntelliJ IDEA ?

This thread has been viewed 1741 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 17, 2018 16:56:05.