[Logo]
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.
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards


This thread has been viewed 1666 times.

All times above are in ranch (not your local) time.
The current ranch time is
Dec 18, 2017 05:38:01.