You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chetan Pandey <cp...@bluesingapore.com> on 2006/10/10 06:05:17 UTC

Tag Not Working

Hi All:

 

I have defined a Variable using <bean:define> Tag that is printed in the
next Line using a Logic:notEmpty check.

 

But the problem is that it will print anyhow whether it is empty or Not. And
the resulting print of "null" in the JSP is unacceptable.

 

Here is my Definition

<bean:define id="noCourseChosenErrorMessage">

<%=session.getAttribute("NoCourseChosen") %>

</bean:define>

 

Here is the Logic:notEMpty Tag

 

<logic:notEmpty name="noCourseChosenErrorMessage">

<p style="color:red"> <bean:write name="noCourseChosenErrorMessage"/>
<br></p>

</logic:notEmpty>

 

If "noCourseChosenErrorMessage" is null it still gets printed. Why ?

 

Is logic:notEMpty unable to detect it whereas bean:write can.

 

If so why.

 

Thanks.

 

CHetan


Re: Tag Not Working

Posted by Antonio Petrelli <ap...@apache.org>.
Chetan Pandey ha scritto:
> <bean:define id="noCourseChosenErrorMessage">
>
> <%=session.getAttribute("NoCourseChosen") %>
>
> </bean:define>
>   

Hehe! This is not null but "null", I mean the string containing "null", 
because you put an HTML value (that is a string).
You should use:

<bean:define id="noCourseChosenErrorMessage" scope="session" name="NoCourseChosen">

HTH
Antonio


P.S.: Saying that "something in Struts does not work" is considered not 
polite.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org