This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts: logic tags on non-bean entities (Strings). Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts: logic tags on non-bean entities (Strings)." Watch "Struts: logic tags on non-bean entities (Strings)." New topic
Author

Struts: logic tags on non-bean entities (Strings).

Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Howdy. As usual, I figured out one problem only to run into another.

Is there anyway I can use "logic:equal" to compare two Strings in a .jsp page?

I'd like to use it to see if a parameter that I'm passing to a tile has a certain value.

I've been trying logic:equal paramater ="tiles:get name='myParamater'" value ="myTestValue", but that hasn't been working. I've also tried getAsString with the same results.

Anyone have any ideas? Is there a way I could use some inpage Java to solve this? (Since I can't assign anything dynamically, I don't really think so though).
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30138
    
150

Karl,
You could use bean efine to get the first string in a bean.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Is the only solution then to actually create a bean for which to test? Methinks the logic tag could do with an upgrade.

Thanks for the response, I'll give that a try.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts: logic tags on non-bean entities (Strings).
 
Similar Threads
jsp Exception
Logic:iterate + OR condition
logic tags in struts
How to replace a if(boolean) script with struts tag?
Struts Templates and Logic