This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Struts and the fly likes logic:present not validating as it was supposed to. where did i got it wrong ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "logic:present not validating as it was supposed to. where did i got it wrong ?" Watch "logic:present not validating as it was supposed to. where did i got it wrong ?" New topic
Author

logic:present not validating as it was supposed to. where did i got it wrong ?

Mel Cen
Greenhorn

Joined: Apr 23, 2011
Posts: 7
regarding the problem ,

i cant get this piece of code to work.



<logic:present name="error" property="ErrorMessage">
Error: <bean:write name="error" property="ErrorMessage"/>
</logic:present>


If i am not mistaken, during the first time this page(Login.jsp) was load, this part of code will not be evaulated becoz error bean object is not present.

However, during submit, and i have debugged,

request.getSession().setAttribute("error", error);

gets executed and with mapping, the control was forwarded back to Login.jsp.

however, the code above was skipped again..

during object lookup, the object error is present but i am clueless on why it will not show the error?
==============================================================================

this are my tag lib(s)

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="Login" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>

this is my ErrorClass class :



and this is my code



Update : got it working with a little google seach..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61764
    
  67

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: logic:present not validating as it was supposed to. where did i got it wrong ?