Skip to main content



      Home
Home » Eclipse Projects » Equinox » Including resources by jsp include tag doesn't work!?
Including resources by jsp include tag doesn't work!? [message #88572] Tue, 22 May 2007 06:59 Go to next message
Eclipse UserFriend
Hi Simon,

I'm now using the latest Equinox bundles to run my webapp with Tomcat5.5:

- org.eclipse.equinox.http(1.0.100.qualifier)
- org.eclipse.equinox.http.servlet(1.0.0.qualifier)
- org.eclipse.equinox.http.servletbridge (1.0.0.qualifier)
- org.eclipse.equinox.jsp.jasper (1.0.0.qualifier)

+ ORBIT bundles for jsp support:

- javax.servlet_2.4.0.v200704241052.jar
- javax.servlet.jsp_2.0.0.v200703221034.jar
- org.apache.jasper_5.5.17.v200704241052.jar
- org.apache.commons.el_1.0.0.v200704241052.jar
- org.apache.commons.logging_1.0.4.v200701082340.jar


Now, mutli-level jsp includes work fine, but when it comes to resource
includes by jsp include tags (e.g. <jsp:include page="foo.html"/>), an
IllegalStateException is thrown in the ResourceRegistration
(org.eclipse.equinox.http.servlet) when trying to get the output stream
from the ServletResponseWrapperInclude to write the resource.

In this case, Tomcat uses the PrintWriter instead of the
ServletOutputStream to include non-jsp files:

DefaultServlet.serveResource() {
....

// Trying to retrieve the servlet output stream
try {
ostream = response.getOutputStream();
} catch (IllegalStateException e) {
// If it fails, we try to get a Writer instead if we're
// trying to serve a text file
if ( (contentType == null)
|| (contentType.startsWith("text")) ) {
writer = response.getWriter();
} else {
throw e;
}
}
...

Is that a known bug (couldn't find anything about this issue)??

thx,
teos
Re: Including resources by jsp include tag doesn't work!? [message #88606 is a reply to message #88572] Tue, 22 May 2007 10:32 Go to previous message
Eclipse UserFriend
I think I understand the use-case.
I'm guessing that what's happened is that elsewhere the response has already
opened a writer. Seems reasonable to try a writer if we get an
IllegalStateException when serving up a reosurce -- I'll open a bug.

-Simon


"teos" <sasa.teofanovic@gmx.at> wrote in message
news:63a35911d0afcc84ba4981fb5d76c096$1@www.eclipse.org...
> Hi Simon,
>
> I'm now using the latest Equinox bundles to run my webapp with Tomcat5.5:
>
> - org.eclipse.equinox.http(1.0.100.qualifier)
> - org.eclipse.equinox.http.servlet(1.0.0.qualifier)
> - org.eclipse.equinox.http.servletbridge (1.0.0.qualifier)
> - org.eclipse.equinox.jsp.jasper (1.0.0.qualifier)
>
> + ORBIT bundles for jsp support:
>
> - javax.servlet_2.4.0.v200704241052.jar
> - javax.servlet.jsp_2.0.0.v200703221034.jar
> - org.apache.jasper_5.5.17.v200704241052.jar
> - org.apache.commons.el_1.0.0.v200704241052.jar
> - org.apache.commons.logging_1.0.4.v200701082340.jar
>
>
> Now, mutli-level jsp includes work fine, but when it comes to resource
> includes by jsp include tags (e.g. <jsp:include page="foo.html"/>), an
> IllegalStateException is thrown in the ResourceRegistration
> (org.eclipse.equinox.http.servlet) when trying to get the output stream
> from the ServletResponseWrapperInclude to write the resource.
>
> In this case, Tomcat uses the PrintWriter instead of the
> ServletOutputStream to include non-jsp files:
>
> DefaultServlet.serveResource() {
> ...
>
> // Trying to retrieve the servlet output stream
> try {
> ostream = response.getOutputStream();
> } catch (IllegalStateException e) {
> // If it fails, we try to get a Writer instead if we're
> // trying to serve a text file
> if ( (contentType == null)
> || (contentType.startsWith("text")) ) {
> writer = response.getWriter();
> } else {
> throw e;
> }
> }
> ..
>
> Is that a known bug (couldn't find anything about this issue)??
>
> thx,
> teos
>
>
>
Previous Topic:tomcat deploy error
Next Topic:Starting the server
Goto Forum:
  


Current Time: Wed May 07 21:59:14 EDT 2025

Powered by FUDForum. Page generated in 0.05238 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top