Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 10:59 Go to next message
Sasa Teofanovic is currently offline Sasa TeofanovicFriend
Messages: 12
Registered: July 2009
Junior Member
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 14:32 Go to previous message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
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: Fri Apr 26 07:08:16 GMT 2024

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

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

Back to the top