The final version of JSTL will most likely be substantially more lenient
with respect to values that don't exist.  Unfortunately, there's not much
I can advise other than, "Wait for the upcoming version!"  :-)  (Such is
the nature of early-access releases.)

Shawn Bayern
Author, "JSP Standard Tag Library"
(coming this spring from Manning Publications)

On Wed, 20 Feb 2002, Steve Morrison wrote:

> I'm considering moving a large codebase of proprietary templates 
> to jsp, and the jstl in particular.  A problem I've had so far 
> is with using SPEL and if tag.  Such as:
>   <c:if test="$param:myParam == '1'">do stuff</c:if>
> and myParam does not exist in the url query string, an exception 
> is thrown.  We have many parameters that aren't required which
> initialize to default values, but we want an easy way to test 
> against their existence in jsp.  The request tag library has 
> some nice ways of doing this, but I like the idea of using one 
> set of tag libraries, not a mish-mash of many incompatible ones.  
> I just don't think tags like this should throw exceptions on 
> non-unrecoverable errors.  Instead, it should just return an 
> empty string (or some reasonable equivalent).
> a way around this would be to use Ecmascript to hold a reference
> to some object, which we use get/set methods on, for example:
> <% request.setAttribute("req",request); %>
> but we're having a hard time passing values to this object
> <c:if test="$req.getParameterName("myParam")">...</c:if>
> but the syntax doesn't seem to work - is there a way around this?
> -Steve
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to