You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by andy wix <st...@hotmail.com> on 2004/09/30 16:59:28 UTC

jstl and the brink of madness

Hi,

The following expression always evaluates to true even though I can see the 
create parameter in the request.

<%@ taglib uri="jstl/c" prefix="c" %>

<c:choose>
  <c:when test="${empty param.create}">hello</c:when>
  <c:otherwise>goodbye</c:otherwise>
</c:choose>

I set the parameter up in the previous action with:
request.setAttribute("create","create");

Any ideas?

Thanks,
Andy

_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo


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


Re: jstl and the brink of madness

Posted by Fredrik Sundberg <fr...@gmail.com>.
Try ${empty create} instead.
Regards,
/Fredrik




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


Re: jstl and the brink of madness

Posted by Luis Urueña Frías <lu...@acotelsa.com>.
Hi,

    be careful!!

    Not is the same a HTTP parameter (arrives in the HTTP header or content
of the HTTP procotol)
like an Attribute, which is an object attached to the request, context or
session Java implementation.
Only parameter haven´t Java dependence....

If you want yor code rules try:

<%@ taglib uri="jstl/c" prefix="c" %>
<c:choose>
  <c:when test="${create}" scope="request">hello</c:when>
  <c:otherwise>goodbye</c:otherwise>
</c:choose>

I set the parameter up in the previous action with:
request.setAttribute("create","create");

(It's not tested...)

Regards,

Luis Urueña Frías Oficina 101
Edificio Galileo, módulo Rojo
Parque Tecnológico de Boecillo Valladolid - España



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


Re: jstl and the brink of madness

Posted by Duncan Mills <du...@oracle.com>.
Shouldn't your test be:
<c:choose>
 <c:when test="${empty requestScope.create}">hello</c:when>
 <c:otherwise>goodbye</c:otherwise>
</c:choose>
As you've set this as a Request attribute

Regards

Duncan Mills

andy wix wrote:

> Hi,
>
> The following expression always evaluates to true even though I can 
> see the create parameter in the request.
>
> <%@ taglib uri="jstl/c" prefix="c" %>
>
> <c:choose>
>  <c:when test="${empty param.create}">hello</c:when>
>  <c:otherwise>goodbye</c:otherwise>
> </c:choose>
>
> I set the parameter up in the previous action with:
> request.setAttribute("create","create");
>
> Any ideas?
>
> Thanks,
> Andy
>
> _________________________________________________________________
> Express yourself with cool new emoticons 
> http://www.msn.co.uk/specials/myemo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

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