You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by James Watkin <ja...@anderson.ucla.edu> on 2004/01/23 01:14:42 UTC

Re: Not Throwing Error For Bad In-Context-JSP url Attribute

I'm not an expert in this area, but after looking at the spec:
http://jcp.org/aboutJava/communityprocess/final/jsr052/index.html
it seems like a JspException should be thrown, even for internal URLs. It's 
quite possible that I'm overlooking something though.

- Jim

At 05:50 PM 1/22/2004 -0500, you wrote:
>I think this is addressed in the 7.4 <c:import> section of the JSTL 1.0 
>Spec. There's an explanation of how errors are handled for internal vs. 
>external resources. Give it a look and see if it helps.
>
>James Watkin wrote:
>
>>There seems to be an inconsistent behavior in the way <c:import> throws 
>>errors for non-existent files. When the <c:import> url attribute is an 
>>in-context-jsp (like pageHeader.jsp) that doesn't exist, no error is 
>>thrown. However, when the url attribute is a "file:" that doesn't exist, 
>>an error is thrown. Can anyone confirm, or explain this behavior?
>>I'm using the following pattern:
>><c:catch var="importError">
>>     <c:import url="${param.pageURL}"/>
>></c:catch>
>><c:if test="${not empty importError}">
>>     <c:out value="${importError.message}"/>
>></c:if>
>>Thank you.
>>- Jim
>>______________________________
>>James Watkin
>>ACIS Software Development
>>The Anderson School at UCLA
>>james.watkin@anderson.ucla.edu
>>Voice: 1-310-825-5030
>>   Fax: 1-310-825-4835
>>______________________________
>
>--
>Kris Schneider <ma...@dotech.com>
>D.O.Tech       <http://www.dotech.com/>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>

______________________________
James Watkin
ACIS Software Development
The Anderson School at UCLA
james.watkin@anderson.ucla.edu
Voice: 1-310-825-5030
   Fax: 1-310-825-4835
______________________________ 


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


Re: Not Throwing Error For Bad In-Context-JSP url Attribute

Posted by Kris Schneider <kr...@dotech.com>.
For an internal URL, try the equivalent JSP:

<%
String path = request.getParameter("pageURL");
RequestDispatcher rd = request.getRequestDispatcher(path);
rd.include(request, response);
%>

It seems to behave the same way. With TC 4.1.29, I don't see any log 
info about the include, but on WLS 8.1.2 I get the following:

...<Included resource or file "/foo.jsp" not found from requested 
resource "/import.jsp".>

No exceptions are thrown, however, just an error logged.

James Watkin wrote:

> I'm not an expert in this area, but after looking at the spec:
> http://jcp.org/aboutJava/communityprocess/final/jsr052/index.html
> it seems like a JspException should be thrown, even for internal URLs. 
> It's quite possible that I'm overlooking something though.
> 
> - Jim
> 
> At 05:50 PM 1/22/2004 -0500, you wrote:
> 
>> I think this is addressed in the 7.4 <c:import> section of the JSTL 
>> 1.0 Spec. There's an explanation of how errors are handled for 
>> internal vs. external resources. Give it a look and see if it helps.
>>
>> James Watkin wrote:
>>
>>> There seems to be an inconsistent behavior in the way <c:import> 
>>> throws errors for non-existent files. When the <c:import> url 
>>> attribute is an in-context-jsp (like pageHeader.jsp) that doesn't 
>>> exist, no error is thrown. However, when the url attribute is a 
>>> "file:" that doesn't exist, an error is thrown. Can anyone confirm, 
>>> or explain this behavior?
>>> I'm using the following pattern:
>>> <c:catch var="importError">
>>>     <c:import url="${param.pageURL}"/>
>>> </c:catch>
>>> <c:if test="${not empty importError}">
>>>     <c:out value="${importError.message}"/>
>>> </c:if>
>>> Thank you.
>>> - Jim
>>> ______________________________
>>> James Watkin
>>> ACIS Software Development
>>> The Anderson School at UCLA
>>> james.watkin@anderson.ucla.edu
>>> Voice: 1-310-825-5030
>>>   Fax: 1-310-825-4835
>>> ______________________________
>>
>>
>> -- 
>> Kris Schneider <ma...@dotech.com>
>> D.O.Tech       <http://www.dotech.com/>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>>
>>
> 
> ______________________________
> James Watkin
> ACIS Software Development
> The Anderson School at UCLA
> james.watkin@anderson.ucla.edu
> Voice: 1-310-825-5030
>   Fax: 1-310-825-4835
> ______________________________

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>



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