The moose likes Struts and the fly likes <s:textfield value=" title="" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "<s:textfield value="NEED_TO_CHECK_CONDITION" name="testField"/>" Watch "<s:textfield value="NEED_TO_CHECK_CONDITION" name="testField"/>" New topic

<s:textfield value="NEED_TO_CHECK_CONDITION" name="testField"/>

Rohit Rai
Ranch Hand

Joined: Aug 04, 2008
Posts: 53
I am trying to do a conditional check in s:textfield.
e.g. i will display XXX if some condition is true and YYY if false

Is it possible to do it?
Also if i go in for some other approach like using s:set


How do i test this value in s:textfield for display?

Any pointers ???

Thanks a lot
David Newton

Joined: Sep 29, 2008
Posts: 12617

<s:set ...><s:if...></s:set>


Use OGNL; "foo == 5 ? 'wat' : 'ohai'"

You can't nest custom tags like you've tried.
I agree. Here's the link: http://aspose.com/file-tools
subject: <s:textfield value="NEED_TO_CHECK_CONDITION" name="testField"/>
Similar Threads
Struts2: Disable textfield
Struts2 test condition in s:if not working
How to use <s:if> tag in another Struts2 tag
passing values from struts2 form to javascript
conditional tags not working - struts2