Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 Badass: Making Users Awesome this week in the Game Development 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
Author

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

Rohit Rai
Ranch Hand

Joined: Aug 04, 2008
Posts: 53
Hi,
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

e.g.

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

Any pointers ???

Thanks a lot
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

or

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

You can't nest custom tags like you've tried.
 
 
subject: <s:textfield value="NEED_TO_CHECK_CONDITION" name="testField"/>