Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP set value with fn:length  RSS feed

 
Samar Land
Ranch Hand
Posts: 68
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to convert my code from struts to jstl .. This was working in struts:





This what I'm trying to do ..  by setting the value of each variable  .



I'm geting this error:

   
 
Samar Land
Ranch Hand
Posts: 68
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I got why I'm getting this issue,

the fn:length() only works on String ,,,

 
Samar Land
Ranch Hand
Posts: 68
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup.. this was the issue, I had to know this before :/

the fn:length() only works on String (which would return the value of String#length() method) and on Collection (which would return the value of Collection#size() method).

 
Stefan Evans
Bartender
Posts: 1834
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I presume your code now looks more like:


note:
- your original EL example checked minMailId twice
- email.getMinMailId() --> ${email.minMailId}  - you originally had ${email.MinMailId} which is not the same :-)

This example doesn't relate to struts at all - it is pure jsp scriptlet code --> JSTL

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