This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Logic Empty Tag Struts1.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Logic Empty Tag Struts1.2" Watch "Logic Empty Tag Struts1.2" New topic
Author

Logic Empty Tag Struts1.2

Eshwar Prasad
Ranch Hand

Joined: Mar 21, 2008
Posts: 202

I developed a sample struts module using struts1.2. I am trying to implement logicEmpty and logic:notEmpty tags. Below is my code for action and success page.

But as a output, i will always get

User ID is Not Empty
User ID is Empty

Only one of these should be resulted. Please let me know if I have done something wrong here. Actionform is correctly populated and I am able to set the attribute in action class also.

LoginAction.java



success.jsp


Bhagat Singh Rawat
Ranch Hand

Joined: Apr 04, 2009
Posts: 93
Change your JSP like:


Note: name will be used for Form Name.
Jesus Mireles
Ranch Hand

Joined: Mar 10, 2010
Posts: 122

Have you tried doing:

<logic:empty name="LoginActionForm" property="userID">
Eshwar Prasad
Ranch Hand

Joined: Mar 21, 2008
Posts: 202

I tried both the ways mentioned below and still the problem remains.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Logic Empty Tag Struts1.2