• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

s:if test troubles, How to test these expression

 
Moli molina
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to test these expression:

If I do
<s:if test="%{sessionUser.role == 'A'}">

test evaluates correctly, but when a try to make a different:

<s:if test="%{sessionUser.role != 'A'}">

sessionUser.role is a char, not a string.


Many thanks for your time!

 
Richard Golebiowski
Ranch Hand
Posts: 213
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did a test app on Linux and Windows systems with Struts 2.1.8.1 using the following:


On Linux, I couldn't get anything to work. On Windows, it worked.
I even followed what is said here
 
Richard Golebiowski
Ranch Hand
Posts: 213
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did some more testing. I don't know what happened the first time, but the test code I posted is now working on my Linux system!
 
Moli molina
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your example and tests.

I think my troubles are other because my object is in session, but in my action, and jsp, I think this object isn't in session and never test well.
In other test I made your solution works well.

Thanks a lot!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic