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 how to show the duplicate value. 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 "how to show the duplicate value." Watch "how to show the duplicate value." New topic
Author

how to show the duplicate value.

pankaj semwal
Ranch Hand

Joined: Oct 07, 2008
Posts: 300
Hi,

i am using strut2.

In my DAO class i use the following code

workorder.setStrErrMessage("Work order No already exixts !");


I want to display the value of strErrMessage in jsp page.if its exits

and in jsp i did like this.

<s:if test="strErrMessage != null && strErrMessage.size > 0 " >
<s:property value="strErrMessage" />


</s:if>


Can any body tell me how to do this.






Thanks
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

What is this workorder that you are adding the message to?? I think you should once take a look at this tutorial...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If the strErrMessage isn't an action property then you can't access it like it is--if the *workorder* is an action property then you'd refer to the property as workorder.strErrMessage.

Whether or not this is the "Struts 2" way to do error reporting really depends on what exactly you're trying to do.
 
Don't get me started about those stupid light bulbs.
 
subject: how to show the duplicate value.
 
Similar Threads
passing values from struts2 form to javascript
Taglib that translates into a series of other taglib calls
Struts2 test condition in s:if not working
How to use <s:if> tag in another Struts2 tag
<s:textfield value="NEED_TO_CHECK_CONDITION" name="testField"/>