struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Born" <>
Subject Re: logic-el and the request object
Date Sun, 02 Feb 2003 22:37:33 GMT
I wasn't looking in the JSTL spec, once I looked there I found an
example I could extrapolate from.  Thanks for pointing me in the right
direction David.  BTW your example was exactly what I needed also, so
thanks again.


-----Original Message-----
From: David M. Karr [] 
Sent: Sunday, February 02, 2003 3:35 PM
Subject: Re: logic-el and the request object

>>>>> "Jeff" == Jeff Born <> writes:

    Jeff> I have been unsuccessfully trying to figure out how to do
something like
    Jeff> the following:
    Jeff> <logic-el:present name="request" parameter="contextPath"> do
    Jeff> </logic-el:present>
    Jeff> if this possible? Am I going about it all wrong?  I really
want to check
    Jeff> for the existence of getParameter("body") and if the body tag
exists do
    Jeff> something.  After playing with it I couldn't even get the
other example
    Jeff> to work right, and pretty much have fell back to the following
    Jeff> <% if ((String tempBody = request.getParameter("body")) ==
null) { %>
    Jeff> do something
    Jeff> <% } else { %>
    Jeff> do something else
    Jeff> <% } %>
    Jeff> How do I do this!!!?!?
If you're using "logic-el", then you might as well use the JSTL, which
is more
suited for this.  Note that your sample code differs slightly from what
said in english, but this should be close enough for you.  If you want
reverse the test, change "empty" to "not empty".  Note that this code
been compiled.

   <c:when test="${empty param.body}">
    Do something.
    Do something else.

I suggest you read the JSTL specification.

David M. Karr          ; Java/J2EE/XML/Unix/C++   ; SCJP; SCWCD

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message