jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Bergsten <h...@gefionsoftware.com>
Subject Re: Lack of good error message
Date Fri, 01 Aug 2003 18:47:36 GMT
Eric W Hauser wrote:
> If this is the case, my complaint is probably directed at Caucho then.
> Can you point me to where the is specified in the JSR?  It seems to be
> discussed in an abstract fashion in Section 2.7, but it does
> not really talk about this point in the EL section.  Also, is this change
> part of the 1.1 reference or has it been this way since 1.0? Thanks.

It's been there since JSTL 1.0 and is preserved in JSP 2.0, where the EL
is now evolving. In the JSTL 1.0 spec, look at section A.3.4.

Hans

> On Thu, 31 Jul 2003, Hans Bergsten wrote:
> 
> 
>>Eric W Hauser wrote:
>>
>>>I posted this to taglibs-user, but it's probably better suited for here.
>>>I was wondering about the lack of a useful error message when JSTL
>>>attempts to call a accessor that does not exist.  For instance, calling an
>>>EL expression like ${bean.name} where getName() does not exist in the bean
>>>class.  In this instance, this is just ignored and nothing is output.  I
>>>can see the argument for this, but I also can see the argument for a
>>>JspException in this case.  At least, would it not be useful to include
>>>the option of turning this on a context parameter?  One of my only
>>>complaints about JSTL is the fact that it is difficult to debug because of
>>>this.
>>
>>${bean.name} does give you a JspException, if "bean" is a bean and it
>>doesn't have a public getName() method. If "bean" is a Map, though, you
>>don't get an exception. This inconsistency was made to avoid having to
>>deal with exceptions in the very common case of using a request parameter
>>value that may or may not be present, e.g.:
>>
>>   <input name="foo" value="${param.foo}">
>>
>>in a JSP 2.0 container. If an exception was thrown when "foo" isn't
>>present, you would have to wrap this whole thing in lots of code testing
>>if it's there.
>>
>>So, if you don't get an exception for the bean property case, it's a
>>bug. I've tested with both Standard 1.0.1, and it works as it should.
>>
>>Hans
>>-- 
>>Hans Bergsten                                <hans@gefionsoftware.com>
>>Gefion Software                       <http://www.gefionsoftware.com/>
>>Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
>>Details at                                    <http://TheJSPBook.com/>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
>>
>>
>>
> 
> 
> -------------------
> Eric Hauser
> ehauser@indiana.edu
> (317) 679-4766
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org
> 

-- 
Hans Bergsten                                <hans@gefionsoftware.com>
Gefion Software                       <http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at                                    <http://TheJSPBook.com/>


Mime
View raw message