You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Kusel, Jonathan J" <Ku...@scmb.co.za> on 2001/12/07 11:22:05 UTC

Unable to include *.sum files (Again)

Hi all,
I've mailed the follwoing to the tomcat users group but nobody has responded
yet so I took the liberty of posting it again.

Here's the message:
-------------------------------->

I'm trying to include normal text files with ".sum"  extensions using the
jsp:include directive:
   '<jsp:include page="testTxt.sum" flush="true" />'
but tomcat throws an exception(see bottom for the exception). When I change
the file's extension to .txt for example it works, but the files that I
wan't to include are generated by another program on a daily basis so
changing the extension is not an option.

When I use the '<%@include file="testTxt.sum" %>' directive it works, but I
need to use the <jsp:include> since the filenames are dynamically generated.

Is this a bug or am I doing something wrong? I'm using tomcat4.0 for NT 4.0.

THE STACKTRACE:
----------------

ApplicationDispatcher[/interestrates]: Servlet.service() for servlet default
threw exception
java.lang.IllegalStateException
at
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv
letResponseWrapperInclude.java:109)
at
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav
a:1143)
at
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:679)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
er.java:570)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
.java:493)
at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
18)
at org.apache.jsp.test$jsp._jspService(test$jsp.java:67)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:201)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:163)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:371)
at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:424)
at java.lang.Thread.run(Thread.java:484)
StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException
java.lang.IllegalStateException
at
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv
letResponseWrapperInclude.java:109)
at
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav
a:1143)
at
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:679)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
er.java:570)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
.java:493)
at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
18)
at org.apache.jsp.test$jsp._jspService(test$jsp.java:67)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:201)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:163)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:371)
at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:424)
at java.lang.Thread.run(Thread.java:484)

Regards,
Jonathan Küsel
SCMB - Treasury IT 
mailto:kuselj@scmb.co.za
(011) 636 1160 

 




Disclaimer and Confidentiality Note.

Everything in this e-mail and attachments relating to the
official business of Standard Bank Investment Corporation(Stanbic)
is proprietary to the company. It is confidential, legally privileged
and protected by law. Stanbic does not own and endorse
any other content. Views and opinions are those of the
sender unless clearly stated as being that of Stanbic.

The person addressed in the e-mail is the sole authorised recipient.
Please notify the sender immediately if it has unintentionally reached
you and do not read, disclose or use the content in any way.

Stanbic can not assure that the integrity of this communication has been
maintained nor that it is free of errors, virus, interception or interference.






--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Jeff Kilbride <je...@kilbride.com>.
Just for fun, I tested this with the snoop.jsp file included in the examples
by adding:

<jsp:include page="./testTxt.sum" flush="true" />

I then created a one-line testTxt.sum file in the same directory with the
following contents:

Successfully included testTxt.sum!

You're right! It doesn't work. I get the same exception in my logs. I then
tried several different extensions and found that the only ones that seem to
work are .jsp, .html, and .txt.

This is a bug.

For the time being, can you copy your *.sum files to *.txt in your JSP prior
to the jsp:include directive. It's a hack, but it should work until this is
resolved.

--jeff

----- Original Message -----
From: "Kusel, Jonathan J" <Ku...@scmb.co.za>
To: <to...@jakarta.apache.org>
Sent: Friday, December 07, 2001 2:22 AM
Subject: Unable to include *.sum files (Again)


>
> Hi all,
> I've mailed the follwoing to the tomcat users group but nobody has
responded
> yet so I took the liberty of posting it again.
>
> Here's the message:
> -------------------------------->
>
> I'm trying to include normal text files with ".sum"  extensions using the
> jsp:include directive:
>    '<jsp:include page="testTxt.sum" flush="true" />'
> but tomcat throws an exception(see bottom for the exception). When I
change
> the file's extension to .txt for example it works, but the files that I
> wan't to include are generated by another program on a daily basis so
> changing the extension is not an option.
>
> When I use the '<%@include file="testTxt.sum" %>' directive it works, but
I
> need to use the <jsp:include> since the filenames are dynamically
generated.
>
> Is this a bug or am I doing something wrong? I'm using tomcat4.0 for NT
4.0.
>
> THE STACKTRACE:
> ----------------
>
> ApplicationDispatcher[/interestrates]: Servlet.service() for servlet
default
> threw exception
> java.lang.IllegalStateException
> at
>
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv
> letResponseWrapperInclude.java:109)
> at
>
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav
> a:1143)
> at
> org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
> java:679)
> at
>
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
> er.java:570)
> at
>
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
> .java:493)
> at
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
> 18)
> at org.apache.jsp.test$jsp._jspService(test$jsp.java:67)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> va:202)
> at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
> at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:243)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:201)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> )
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> java:170)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 64)
> at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
> )
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 64)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :163)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:371)
> at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:424)
> at java.lang.Thread.run(Thread.java:484)
> StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw
exception
> java.lang.IllegalStateException
> java.lang.IllegalStateException
> at
>
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv
> letResponseWrapperInclude.java:109)
> at
>
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav
> a:1143)
> at
> org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
> java:679)
> at
>
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
> er.java:570)
> at
>
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
> .java:493)
> at
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
> 18)
> at org.apache.jsp.test$jsp._jspService(test$jsp.java:67)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> va:202)
> at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
> at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:243)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:201)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> )
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> java:170)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 64)
> at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
> )
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 64)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :163)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:371)
> at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:424)
> at java.lang.Thread.run(Thread.java:484)
>
> Regards,
> Jonathan Küsel
> SCMB - Treasury IT
> mailto:kuselj@scmb.co.za
> (011) 636 1160
>
>
>
>
>
>
> Disclaimer and Confidentiality Note.
>
> Everything in this e-mail and attachments relating to the
> official business of Standard Bank Investment Corporation(Stanbic)
> is proprietary to the company. It is confidential, legally privileged
> and protected by law. Stanbic does not own and endorse
> any other content. Views and opinions are those of the
> sender unless clearly stated as being that of Stanbic.
>
> The person addressed in the e-mail is the sole authorised recipient.
> Please notify the sender immediately if it has unintentionally reached
> you and do not read, disclose or use the content in any way.
>
> Stanbic can not assure that the integrity of this communication has been
> maintained nor that it is free of errors, virus, interception or
interference.
>
>
>
>
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Micael Padraig Og mac Grene <ca...@harbornet.com>.
At 06:10 PM 12/8/01 -0800, you wrote:
>I agree that there are workarounds -- there are always workarounds -- but
>Tomcat is the RI, so this is the place where we're supposed to figure this
>stuff out.
>
>I guess my argument is that Tomcat is being more restrictive than the spec
>requires it to be. Whether that's acceptable or not is ultimately up to the
>tomcat dev team.
>
>Thanks,
>--jeff


My last offering, Jeff, is that I think that the specs are pretty clear 
that the writing is done by JspWriter which has the upshot you face.  I 
don't consider the solutions to be workarounds.  Actually, as a design 
matter, I find your first instincts to be what I would consider to be a 
work around.  But, in design there are different strokes for different folks.

-- micael


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Jeff Kilbride <je...@kilbride.com>.
I agree that there are workarounds -- there are always workarounds -- but
Tomcat is the RI, so this is the place where we're supposed to figure this
stuff out.

I guess my argument is that Tomcat is being more restrictive than the spec
requires it to be. Whether that's acceptable or not is ultimately up to the
tomcat dev team.

Thanks,
--jeff

----- Original Message -----
From: "Micael Padraig Og mac Grene" <ca...@harbornet.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Saturday, December 08, 2001 4:27 PM
Subject: Re: Unable to include *.sum files (Again)


> At 03:53 PM 12/8/01 -0800, you wrote:
> >If it does use PrintWriter to write the output, then it makes sense for
> >it to only output text. See this from the PrintWriter javadoc:
> >
> >Print formatted representations of objects to a text-output stream.
> >This class implements all of the print methods found in PrintStream. It
> >does not contain methods for writing raw bytes, for which a program
> >should use unencoded byte streams.
> >
> >If you want to include files of non-text types (or types that are text,
> >but not included in your MIME types list), why not just write a utility
> >method that opens a file, reads it and returns its contents as a
> >String?
> >
> >-August
>
> Yah, August, we all agree on that.  Jeff is thinking that the
> specifications are not clear enough.  Just a difference of "style" I
> suppose.  Thanks for your input.
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Micael Padraig Og mac Grene <ca...@harbornet.com>.
At 03:53 PM 12/8/01 -0800, you wrote:
>If it does use PrintWriter to write the output, then it makes sense for
>it to only output text. See this from the PrintWriter javadoc:
>
>Print formatted representations of objects to a text-output stream.
>This class implements all of the print methods found in PrintStream. It
>does not contain methods for writing raw bytes, for which a program
>should use unencoded byte streams.
>
>If you want to include files of non-text types (or types that are text,
>but not included in your MIME types list), why not just write a utility
>method that opens a file, reads it and returns its contents as a
>String?
>
>-August

Yah, August, we all agree on that.  Jeff is thinking that the 
specifications are not clear enough.  Just a difference of "style" I 
suppose.  Thanks for your input.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Jeff Kilbride <je...@kilbride.com>.
Ok, but what happens if you don't have control of the included file? Your
database or other source produces dynamic reports for you and you need to
include them into your JSPs.

My question is this: if nearly every webserver on the planet can use a
default MIME type of text/html, why can't this? That would solve the
problem. Restricting output to registered MIME types seems a little heavy
handed to me.

Thanks,
--jeff

----- Original Message -----
From: "Micael Padraig Og mac Grene" <ca...@harbornet.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Saturday, December 08, 2001 2:58 PM
Subject: Re: Unable to include *.sum files (Again)


> At 02:51 PM 12/8/01 -0800, you wrote:
> >I don't think the spec is that detailed -- I mean, it doesn't come out
and
> >say the "page" attribute of jsp:include has to follow the requirements of
> >the JspWriter. So, I don't know the answer to that.
> >
> >Remember though, we're talking about included files -- by their very
nature,
> >they don't necessarily represent *entire* files. They may only be pieces
of
> >a bigger file that is ultimately displayed to the surfer. I can
understand
> >that the file sent to the browser must have a sensible MIME type, but
must
> >all the pieces that the file is built from also have registered MIME
types?
> >I'm not sure that makes sense.
> >
> >Also, I always thought MIME types, in this context, were available so the
> >browser could decipher what kind of file was being retrieved and display
> >that file correctly. I never thought MIME types would be used to limit my
> >flexibility with JSPs in this way.
> >
> >Thanks,
> >--jeff
>
> I understand what you are saying, Jeff.  But the bottom line is that the
> JspWriter is the source of the out implicit object in this
> instance.  Apparently your bottom line is that you want to use the
> extension to pass information, instead of an extension in any true
> sense.  I think it is a little harsh to have them "expect" that use.  That
> said, and I may be wrong, why not toss the '"dynamic" values in prior to
> the extension and trick the JspWriter, e.g. instead of com.site.123 us
> com.site.123.txt or com.site.123.jsp.  You are going to have to have a
> class read the url in any event.  The other way is to put your dynamic
> information inside the included tidbit.  That seems more intuitive to me
> than using an extension for information anyway.  Just a thought.
>
> -- micael
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Micael Padraig Og mac Grene <ca...@harbornet.com>.
At 02:51 PM 12/8/01 -0800, you wrote:
>I don't think the spec is that detailed -- I mean, it doesn't come out and
>say the "page" attribute of jsp:include has to follow the requirements of
>the JspWriter. So, I don't know the answer to that.
>
>Remember though, we're talking about included files -- by their very nature,
>they don't necessarily represent *entire* files. They may only be pieces of
>a bigger file that is ultimately displayed to the surfer. I can understand
>that the file sent to the browser must have a sensible MIME type, but must
>all the pieces that the file is built from also have registered MIME types?
>I'm not sure that makes sense.
>
>Also, I always thought MIME types, in this context, were available so the
>browser could decipher what kind of file was being retrieved and display
>that file correctly. I never thought MIME types would be used to limit my
>flexibility with JSPs in this way.
>
>Thanks,
>--jeff

I understand what you are saying, Jeff.  But the bottom line is that the 
JspWriter is the source of the out implicit object in this 
instance.  Apparently your bottom line is that you want to use the 
extension to pass information, instead of an extension in any true 
sense.  I think it is a little harsh to have them "expect" that use.  That 
said, and I may be wrong, why not toss the '"dynamic" values in prior to 
the extension and trick the JspWriter, e.g. instead of com.site.123 us 
com.site.123.txt or com.site.123.jsp.  You are going to have to have a 
class read the url in any event.  The other way is to put your dynamic 
information inside the included tidbit.  That seems more intuitive to me 
than using an extension for information anyway.  Just a thought.

-- micael


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Jeff Kilbride <je...@kilbride.com>.
I don't think the spec is that detailed -- I mean, it doesn't come out and
say the "page" attribute of jsp:include has to follow the requirements of
the JspWriter. So, I don't know the answer to that.

Remember though, we're talking about included files -- by their very nature,
they don't necessarily represent *entire* files. They may only be pieces of
a bigger file that is ultimately displayed to the surfer. I can understand
that the file sent to the browser must have a sensible MIME type, but must
all the pieces that the file is built from also have registered MIME types?
I'm not sure that makes sense.

Also, I always thought MIME types, in this context, were available so the
browser could decipher what kind of file was being retrieved and display
that file correctly. I never thought MIME types would be used to limit my
flexibility with JSPs in this way.

Thanks,
--jeff

----- Original Message -----
From: "Micael Padraig Og mac Grene" <ca...@harbornet.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Saturday, December 08, 2001 2:06 PM
Subject: Re: Unable to include *.sum files (Again)


> At 01:27 PM 12/8/01 -0800, you wrote:
> >I'm not so sure. The JSP spec doesn't say anything about having to
register
> >the MIME type of a file before using it in a jsp:include directive.
Consider
> >how difficult that would be if you were generating dynamic filenames with
> >extensions like ".001", ".002", ".003", etc... You could potentially have
to
> >register several hundred (even thousand) meaningless MIME types. Also,
think
> >about what webservers do when they encounter an unknown MIME type -- they
> >default back to text/html (or whatever you have set as your default...).
Why
> >should a JSP be more strict than this with it's include directive? The
file
> >you are including is required to be a valid URL -- which means it could
be
> >accessed via the webserver anyway.
> >
> >Remember, Tomcat is the RI and should implement the spec as closely as
> >possible. I've gone back and looked through my books on JSP, and every
one
> >of them says that you can use any file extension with the jsp:include
> >directive. However, none of them say you have to register that extension
as
> >a valid MIME type first. At the very least, it's confusing for someone
who
> >expects it to work when it doesn't -- especially when there's no
> >documentation on it.
> >
> >Thanks,
> >--jeff
> >
> >----- Original Message -----
> >From: "Micael Padraig Og mac Grene" <ca...@harbornet.com>
> >To: "Tomcat Users List" <to...@jakarta.apache.org>
> >Sent: Saturday, December 08, 2001 10:12 AM
> >Subject: Re: Unable to include *.sum files (Again)
> >
> >
> > > At 08:22 PM 12/7/01 -0800, you wrote:
> > > >Yeah, see my last post. Since JSP output is written with a
PrintWriter,
> >the
> > > >Catalina code is restricting it to only being able to output known
text/*
> > > >MIME types. This just doesn't "feel" right to me.
> > > >
> > > >Thanks,
> > > >--jeff
> > >
>
> The JSP specification does tie the use of include to the requirements of
> the out JspWriter ?
> --- micael
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Micael Padraig Og mac Grene <ca...@harbornet.com>.
At 01:27 PM 12/8/01 -0800, you wrote:
>I'm not so sure. The JSP spec doesn't say anything about having to register
>the MIME type of a file before using it in a jsp:include directive. Consider
>how difficult that would be if you were generating dynamic filenames with
>extensions like ".001", ".002", ".003", etc... You could potentially have to
>register several hundred (even thousand) meaningless MIME types. Also, think
>about what webservers do when they encounter an unknown MIME type -- they
>default back to text/html (or whatever you have set as your default...). Why
>should a JSP be more strict than this with it's include directive? The file
>you are including is required to be a valid URL -- which means it could be
>accessed via the webserver anyway.
>
>Remember, Tomcat is the RI and should implement the spec as closely as
>possible. I've gone back and looked through my books on JSP, and every one
>of them says that you can use any file extension with the jsp:include
>directive. However, none of them say you have to register that extension as
>a valid MIME type first. At the very least, it's confusing for someone who
>expects it to work when it doesn't -- especially when there's no
>documentation on it.
>
>Thanks,
>--jeff
>
>----- Original Message -----
>From: "Micael Padraig Og mac Grene" <ca...@harbornet.com>
>To: "Tomcat Users List" <to...@jakarta.apache.org>
>Sent: Saturday, December 08, 2001 10:12 AM
>Subject: Re: Unable to include *.sum files (Again)
>
>
> > At 08:22 PM 12/7/01 -0800, you wrote:
> > >Yeah, see my last post. Since JSP output is written with a PrintWriter,
>the
> > >Catalina code is restricting it to only being able to output known text/*
> > >MIME types. This just doesn't "feel" right to me.
> > >
> > >Thanks,
> > >--jeff
> >

The JSP specification does tie the use of include to the requirements of 
the out JspWriter ?
--- micael


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Jeff Kilbride <je...@kilbride.com>.
I'm not so sure. The JSP spec doesn't say anything about having to register
the MIME type of a file before using it in a jsp:include directive. Consider
how difficult that would be if you were generating dynamic filenames with
extensions like ".001", ".002", ".003", etc... You could potentially have to
register several hundred (even thousand) meaningless MIME types. Also, think
about what webservers do when they encounter an unknown MIME type -- they
default back to text/html (or whatever you have set as your default...). Why
should a JSP be more strict than this with it's include directive? The file
you are including is required to be a valid URL -- which means it could be
accessed via the webserver anyway.

Remember, Tomcat is the RI and should implement the spec as closely as
possible. I've gone back and looked through my books on JSP, and every one
of them says that you can use any file extension with the jsp:include
directive. However, none of them say you have to register that extension as
a valid MIME type first. At the very least, it's confusing for someone who
expects it to work when it doesn't -- especially when there's no
documentation on it.

Thanks,
--jeff

----- Original Message -----
From: "Micael Padraig Og mac Grene" <ca...@harbornet.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Saturday, December 08, 2001 10:12 AM
Subject: Re: Unable to include *.sum files (Again)


> At 08:22 PM 12/7/01 -0800, you wrote:
> >Yeah, see my last post. Since JSP output is written with a PrintWriter,
the
> >Catalina code is restricting it to only being able to output known text/*
> >MIME types. This just doesn't "feel" right to me.
> >
> >Thanks,
> >--jeff
>
> Well, jeff, then it is not a "bug".  At best it is a difference of
> opinion.  That makes all the sense in the world to me.  If you want to
> bring in something other than the "known 'text/* MIME types," just include
> the proper code in your include?  We have differing intuitions here.  I
> think what Catalina is doing is proper and makes sense.  But, at worst for
> you, it is an inconvenience.  Right?
>
> -- micael
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by August Detlefsen <au...@yahoo.com>.
If it does use PrintWriter to write the output, then it makes sense for
it to only output text. See this from the PrintWriter javadoc: 

Print formatted representations of objects to a text-output stream.
This class implements all of the print methods found in PrintStream. It
does not contain methods for writing raw bytes, for which a program
should use unencoded byte streams. 

If you want to include files of non-text types (or types that are text,
but not included in your MIME types list), why not just write a utility
method that opens a file, reads it and returns its contents as a
String? 

-August

--- Micael Padraig Og mac Grene <ca...@harbornet.com> wrote:
> At 08:22 PM 12/7/01 -0800, you wrote:
> >Yeah, see my last post. Since JSP output is written with a
> PrintWriter, the
> >Catalina code is restricting it to only being able to output known
> text/*
> >MIME types. This just doesn't "feel" right to me.
> >
> >Thanks,
> >--jeff
> 
> Well, jeff, then it is not a "bug".  At best it is a difference of 
> opinion.  That makes all the sense in the world to me.  If you want
> to 
> bring in something other than the "known 'text/* MIME types," just
> include 
> the proper code in your include?  We have differing intuitions here. 
> I 
> think what Catalina is doing is proper and makes sense.  But, at
> worst for 
> you, it is an inconvenience.  Right?
> 
> -- micael
> 
> 
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Micael Padraig Og mac Grene <ca...@harbornet.com>.
At 08:22 PM 12/7/01 -0800, you wrote:
>Yeah, see my last post. Since JSP output is written with a PrintWriter, the
>Catalina code is restricting it to only being able to output known text/*
>MIME types. This just doesn't "feel" right to me.
>
>Thanks,
>--jeff

Well, jeff, then it is not a "bug".  At best it is a difference of 
opinion.  That makes all the sense in the world to me.  If you want to 
bring in something other than the "known 'text/* MIME types," just include 
the proper code in your include?  We have differing intuitions here.  I 
think what Catalina is doing is proper and makes sense.  But, at worst for 
you, it is an inconvenience.  Right?

-- micael


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 7 Dec 2001, Jeff Kilbride wrote:

> Date: Fri, 7 Dec 2001 20:22:46 -0800
> From: Jeff Kilbride <je...@kilbride.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Re: Unable to include *.sum files (Again)
>
> Yeah, see my last post. Since JSP output is written with a PrintWriter, the
> Catalina code is restricting it to only being able to output known text/*
> MIME types. This just doesn't "feel" right to me.
>

I've forwarded this issue to the developer who wrote DefaultServlet (Remy
Maucherat).  Unfortunately, he's in transit at the moment, so it may take
a bit for him to respond.

> Thanks,
> --jeff
>

Craig

> ----- Original Message -----
> From: "Micael Padraig Og mac Grene" <ca...@harbornet.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Friday, December 07, 2001 7:40 PM
> Subject: Re: Unable to include *.sum files (Again)
>
>
> >
> >
> > At 02:21 PM 12/7/01 -0800, you wrote:
> > >Hi Micael,
> > >
> > >Let's make sure we're talking about the same thing. If I include a file
> > >like:
> > >
> > ><jsp:include page="./testTxt.sum" flush="true" />
> > >
> > >Why does it matter what the file extension of the included file is? Isn't
> > >the container just supposed to open the file and output it's contents at
> > >that particular spot in my JSP? Now, I agree that the contents of the
> > >included file will be affected by the MIME type of the response -- how
> the
> > >browser views those contents. If you include a file that doesn't match
> the
> > >MIME type of your response, it may not appear correctly in your browser.
> But
> > >that's not the point.
> > >
> > >The JSP spec says the "page" attribute must evaluate to a String that is
> a
> > >relative URL specification. When I pull up the testTxt.sum file in my
> > >browser, it displays correctly (it's only one line of text...). So, I
> should
> > >be able to include it in my JSP with the jsp:include directive. When I
> > >change the extension to .txt, .html, or .jsp it works. Anything else,
> even
> > >other registered MIME types like .doc, and it doesn't. (ok, I didn't try
> > >them ALL...  :)
> > >
> > >I think this is a bug. The old Java Web Server used to have a similar bug
> > >where it would only include .htm and .html files.
> > >
> > >--jeff
> >
> > Before I look further, have you looked at the source code to see why this
> > is happening?
> >
> >
> > --
> > To unsubscribe:   <ma...@jakarta.apache.org>
> > For additional commands: <ma...@jakarta.apache.org>
> > Troubles with the list: <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Jeff Kilbride <je...@kilbride.com>.
Yeah, see my last post. Since JSP output is written with a PrintWriter, the
Catalina code is restricting it to only being able to output known text/*
MIME types. This just doesn't "feel" right to me.

Thanks,
--jeff

----- Original Message -----
From: "Micael Padraig Og mac Grene" <ca...@harbornet.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, December 07, 2001 7:40 PM
Subject: Re: Unable to include *.sum files (Again)


>
>
> At 02:21 PM 12/7/01 -0800, you wrote:
> >Hi Micael,
> >
> >Let's make sure we're talking about the same thing. If I include a file
> >like:
> >
> ><jsp:include page="./testTxt.sum" flush="true" />
> >
> >Why does it matter what the file extension of the included file is? Isn't
> >the container just supposed to open the file and output it's contents at
> >that particular spot in my JSP? Now, I agree that the contents of the
> >included file will be affected by the MIME type of the response -- how
the
> >browser views those contents. If you include a file that doesn't match
the
> >MIME type of your response, it may not appear correctly in your browser.
But
> >that's not the point.
> >
> >The JSP spec says the "page" attribute must evaluate to a String that is
a
> >relative URL specification. When I pull up the testTxt.sum file in my
> >browser, it displays correctly (it's only one line of text...). So, I
should
> >be able to include it in my JSP with the jsp:include directive. When I
> >change the extension to .txt, .html, or .jsp it works. Anything else,
even
> >other registered MIME types like .doc, and it doesn't. (ok, I didn't try
> >them ALL...  :)
> >
> >I think this is a bug. The old Java Web Server used to have a similar bug
> >where it would only include .htm and .html files.
> >
> >--jeff
>
> Before I look further, have you looked at the source code to see why this
> is happening?
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Micael Padraig Og mac Grene <ca...@harbornet.com>.

At 02:21 PM 12/7/01 -0800, you wrote:
>Hi Micael,
>
>Let's make sure we're talking about the same thing. If I include a file
>like:
>
><jsp:include page="./testTxt.sum" flush="true" />
>
>Why does it matter what the file extension of the included file is? Isn't
>the container just supposed to open the file and output it's contents at
>that particular spot in my JSP? Now, I agree that the contents of the
>included file will be affected by the MIME type of the response -- how the
>browser views those contents. If you include a file that doesn't match the
>MIME type of your response, it may not appear correctly in your browser. But
>that's not the point.
>
>The JSP spec says the "page" attribute must evaluate to a String that is a
>relative URL specification. When I pull up the testTxt.sum file in my
>browser, it displays correctly (it's only one line of text...). So, I should
>be able to include it in my JSP with the jsp:include directive. When I
>change the extension to .txt, .html, or .jsp it works. Anything else, even
>other registered MIME types like .doc, and it doesn't. (ok, I didn't try
>them ALL...  :)
>
>I think this is a bug. The old Java Web Server used to have a similar bug
>where it would only include .htm and .html files.
>
>--jeff

Before I look further, have you looked at the source code to see why this 
is happening?


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Jeff Kilbride <je...@kilbride.com>.
Hi Micael,

Let's make sure we're talking about the same thing. If I include a file
like:

<jsp:include page="./testTxt.sum" flush="true" />

Why does it matter what the file extension of the included file is? Isn't
the container just supposed to open the file and output it's contents at
that particular spot in my JSP? Now, I agree that the contents of the
included file will be affected by the MIME type of the response -- how the
browser views those contents. If you include a file that doesn't match the
MIME type of your response, it may not appear correctly in your browser. But
that's not the point.

The JSP spec says the "page" attribute must evaluate to a String that is a
relative URL specification. When I pull up the testTxt.sum file in my
browser, it displays correctly (it's only one line of text...). So, I should
be able to include it in my JSP with the jsp:include directive. When I
change the extension to .txt, .html, or .jsp it works. Anything else, even
other registered MIME types like .doc, and it doesn't. (ok, I didn't try
them ALL...  :)

I think this is a bug. The old Java Web Server used to have a similar bug
where it would only include .htm and .html files.

--jeff

----- Original Message -----
From: "Micael Padraig Og mac Grene" <ca...@harbornet.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, December 07, 2001 1:37 PM
Subject: Re: Unable to include *.sum files (Again)


> At 01:31 PM 12/7/01 -0800, you wrote:
> >Nope. I tried it with *.doc files, too, and it still doesn't work. *.doc
is
> >defined in web.xml.
> >
> >Besides, it doesn't really make sense for MIME types to affect included
> >files, does it?
> >
> >--jeff
>
> I may be out to lunch here, Jeff, but it seems to me that it makes all the
> sense in the world for an included file to be affected by its MIME type.
>
> -- micael
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Micael Padraig Og mac Grene <ca...@harbornet.com>.
At 01:31 PM 12/7/01 -0800, you wrote:
>Nope. I tried it with *.doc files, too, and it still doesn't work. *.doc is
>defined in web.xml.
>
>Besides, it doesn't really make sense for MIME types to affect included
>files, does it?
>
>--jeff

I may be out to lunch here, Jeff, but it seems to me that it makes all the 
sense in the world for an included file to be affected by its MIME type.

-- micael


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Help: diff between tomcat 4.0 and tomcat 4.0.1

Posted by Nirmal Rajarathnam <ni...@fresher.com>.
My webapp which was working fine on tomcat 4.0 after I upgraded to 
tomcat 4.0.1 has not worked since. Can someone tell me what is the 
difference between both. I am running the server on Win 2000 with JDK 
1.4 beta 3 on a stand-alone mode. The error seems to be where I call 
getServletContext().getRequestDespatcher(location).forward(request, 
response); (the last line in the error message dump)

Can someone help, point me the mistake.

Thanks,
Nirmal R.

____ Error Message _____


  Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error

------------------------------------------------------------------------

type Exception report

messageInternal Server Error

descriptionThe server encountered an internal error (Internal Server 
Error) that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Can not process 
	at com.company.product.module.ControllerServlet.doGet(ControllerServlet.java:113)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at com.company.product.module.KloverExceptionFilter.doFilter(KloverExceptionFilter.java:35)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:518)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
	at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
	at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
	at java.lang.Thread.run(Thread.java:539)
Caused by: javax.servlet.ServletException: Servlet.init() for servlet jsp threw exception
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:871)
	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:615)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:648)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
	at com.company.product.module.ControllerServlet.doGet(ControllerServlet.java:105)
	... 37 more



Re: Unable to include *.sum files (Again) -- FOUND! Help please, Craig?

Posted by Jeff Kilbride <je...@kilbride.com>.
Ok, This is a longer post, so bear with me. I looked through the source and
found that serveResource() in
org.apache.catalina.servlets.DefaultServlet.java is the culprit. Before
serving the included file, serveResource() retrieves the MIME type of the
included file on line 1194 (cvs from today):

----------
String contentType =
     getServletContext().getMimeType(resourceInfo.path);
----------

Then, on lines 1230 through 1247, if there's any content in the included
file, it tries to serve it:

----------
if (content) {

    // 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;
        }
    }
}
----------

Since the getOutputStream() method of
org.apache.jasper.runtime.ServletResponseWrapperInclude.java always throws
an IllegalStateException, the try above will always fail and serveResource()
will try to obtain a Writer instead. At that point, if you haven't set up an
applicable MIME type for the file you are trying to include, contentType
will be null and the exception will be thrown. If you *have* set up a MIME
type, but it doesn't start with "text", the exception will also be thrown.

Craig, does this make sense for JSPs? I understand why you would do this for
a servlet, but a JSP never has an output stream available -- so this limits
files included with the jsp:include directive to only those that have
registered MIME types that begin with "text". The obvious solution is to put
<mime-mapping> statements for all your file types into web.xml, but what
happens if you're dynamically generating filenames with extensions like
".001", ".002", ".003", etc...  That means you have to add 999 mime-mapping
statements -- if you even know what all the dynamic names will be!

Would it make more sense, for JSP's only, to default the contentType
variable to "text/html"? After all, the web server defaults to "text/html"
for most instances when it can't find an appropriate MIME type. Am I missing
something?

Thanks,
--jeff

----- Original Message -----
From: "Jeff Kilbride" <je...@kilbride.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, December 07, 2001 4:41 PM
Subject: Re: Unable to include *.sum files (Again)


> If it does, then it's violating the spec. The spec doesn't specify any
> extensions that can or cannot be included. It just says it has to be a
> String that is a relative URL. The string "./myText.foo" satisfies that
and
> the file myText.foo pulls up correctly in my browser with the following
> content:
>
> "This is the myText.foo file!"
>
> However, when you include the myText.foo file using the jsp:include
> directive, you get an exception. I think that's a bug.
>
> My setup is TC 4.0.1 stand-alone on RedHat 7.1 using the IBM JDK 1.2 -- in
> case anyone was wondering...
>
> --jeff
>
> ----- Original Message -----
> From: "August Detlefsen" <au...@yahoo.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Friday, December 07, 2001 2:16 PM
> Subject: Re: Unable to include *.sum files (Again)
>
>
> > It might, if somewhere in the code of the <jsp:include> tag it
> > specifies to only include a file if it is of a relevant mime type, say
> > JSP, text/xyz, or image/abc.
> >
> > This would prevent the server from sending out potentially damaging
> > stuff with the include tag, like .java or .exe files.
> >
> > Again, I am just speculating...



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Jeff Kilbride <je...@kilbride.com>.
If it does, then it's violating the spec. The spec doesn't specify any
extensions that can or cannot be included. It just says it has to be a
String that is a relative URL. The string "./myText.foo" satisfies that and
the file myText.foo pulls up correctly in my browser with the following
content:

"This is the myText.foo file!"

However, when you include the myText.foo file using the jsp:include
directive, you get an exception. I think that's a bug.

My setup is TC 4.0.1 stand-alone on RedHat 7.1 using the IBM JDK 1.2 -- in
case anyone was wondering...

--jeff

----- Original Message -----
From: "August Detlefsen" <au...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, December 07, 2001 2:16 PM
Subject: Re: Unable to include *.sum files (Again)


> It might, if somewhere in the code of the <jsp:include> tag it
> specifies to only include a file if it is of a relevant mime type, say
> JSP, text/xyz, or image/abc.
>
> This would prevent the server from sending out potentially damaging
> stuff with the include tag, like .java or .exe files.
>
> Again, I am just speculating...
>
>
>
>
> --- Jeff Kilbride <je...@kilbride.com> wrote:
> > Nope. I tried it with *.doc files, too, and it still doesn't work.
> > *.doc is
> > defined in web.xml.
> >
> > Besides, it doesn't really make sense for MIME types to affect
> > included
> > files, does it?
> >
> > --jeff
> >
> > ----- Original Message -----
> > From: "August Detlefsen" <au...@yahoo.com>
> > To: "Tomcat Users List" <to...@jakarta.apache.org>
> > Sent: Friday, December 07, 2001 12:40 PM
> > Subject: Re: Unable to include *.sum files (Again)
> >
> >
> > > I am totally guessing, but maybe you have to define a MIME type for
> > > .sum files in your web.xml (and perhaps also where Apache
> > configures
> > > MIME types?)?
> > >
> > > HTH,
> > > -August
> > >
> > > --- "Kusel, Jonathan J" <Ku...@scmb.co.za> wrote:
> > > >
> > > > Hi all,
> > > > I've mailed the follwoing to the tomcat users group but nobody
> > has
> > > > responded
> > > > yet so I took the liberty of posting it again.
> > > >
> > > > Here's the message:
> > > > -------------------------------->
> > > >
> > > > I'm trying to include normal text files with ".sum"  extensions
> > using
> > > > the
> > > > jsp:include directive:
> > > >    '<jsp:include page="testTxt.sum" flush="true" />'
> > > > but tomcat throws an exception(see bottom for the exception).
> > When I
> > > > change
> > > > the file's extension to .txt for example it works, but the files
> > that
> > > > I
> > > > wan't to include are generated by another program on a daily
> > basis so
> > > > changing the extension is not an option.
> > > >
> > > > When I use the '<%@include file="testTxt.sum" %>' directive it
> > works,
> > > > but I
> > > > need to use the <jsp:include> since the filenames are dynamically
> > > > generated.
> > > >
> > > > Is this a bug or am I doing something wrong? I'm using tomcat4.0
> > for
> > > > NT 4.0.
> > > >
> > > > THE STACKTRACE:
> > > > ----------------
> > > >
> > > > ApplicationDispatcher[/interestrates]: Servlet.service() for
> > servlet
> > > > default
> > > > threw exception
> > > > java.lang.IllegalStateException
> > > > at
> > > >
> > >
> >
>
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv
> > > > letResponseWrapperInclude.java:109)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav
> > > > a:1143)
> > > > at
> > > >
> > >
> >
> org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
> > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
> > > > java:679)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
> > > > er.java:570)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
> > > > .java:493)
> > > > at
> > > >
> > >
> >
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
> > > > 18)
> > > > at org.apache.jsp.test$jsp._jspService(test$jsp.java:67)
> > > > at
> > > >
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > > at
> > > >
> > >
> >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> > > > va:202)
> > > > at
> > > >
> > >
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
> > > > at
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
> > > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > > > FilterChain.java:247)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > > > ain.java:193)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > > > va:243)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > > 66)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > > > at
> > > >
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > > > va:201)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > > 66)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > > > at
> > > >
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > > > at
> > > >
> > >
> >
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> > > > )
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > > 66)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> > > > java:170)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > > 64)
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
> > > > )
> > > > at
> > > >
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > > 64)
> > > > at
> >
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> Send your FREE holiday greetings online!
> http://greetings.yahoo.com
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by August Detlefsen <au...@yahoo.com>.
It might, if somewhere in the code of the <jsp:include> tag it
specifies to only include a file if it is of a relevant mime type, say
JSP, text/xyz, or image/abc. 

This would prevent the server from sending out potentially damaging
stuff with the include tag, like .java or .exe files. 

Again, I am just speculating...




--- Jeff Kilbride <je...@kilbride.com> wrote:
> Nope. I tried it with *.doc files, too, and it still doesn't work.
> *.doc is
> defined in web.xml.
> 
> Besides, it doesn't really make sense for MIME types to affect
> included
> files, does it?
> 
> --jeff
> 
> ----- Original Message -----
> From: "August Detlefsen" <au...@yahoo.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Friday, December 07, 2001 12:40 PM
> Subject: Re: Unable to include *.sum files (Again)
> 
> 
> > I am totally guessing, but maybe you have to define a MIME type for
> > .sum files in your web.xml (and perhaps also where Apache
> configures
> > MIME types?)?
> >
> > HTH,
> > -August
> >
> > --- "Kusel, Jonathan J" <Ku...@scmb.co.za> wrote:
> > >
> > > Hi all,
> > > I've mailed the follwoing to the tomcat users group but nobody
> has
> > > responded
> > > yet so I took the liberty of posting it again.
> > >
> > > Here's the message:
> > > -------------------------------->
> > >
> > > I'm trying to include normal text files with ".sum"  extensions
> using
> > > the
> > > jsp:include directive:
> > >    '<jsp:include page="testTxt.sum" flush="true" />'
> > > but tomcat throws an exception(see bottom for the exception).
> When I
> > > change
> > > the file's extension to .txt for example it works, but the files
> that
> > > I
> > > wan't to include are generated by another program on a daily
> basis so
> > > changing the extension is not an option.
> > >
> > > When I use the '<%@include file="testTxt.sum" %>' directive it
> works,
> > > but I
> > > need to use the <jsp:include> since the filenames are dynamically
> > > generated.
> > >
> > > Is this a bug or am I doing something wrong? I'm using tomcat4.0
> for
> > > NT 4.0.
> > >
> > > THE STACKTRACE:
> > > ----------------
> > >
> > > ApplicationDispatcher[/interestrates]: Servlet.service() for
> servlet
> > > default
> > > threw exception
> > > java.lang.IllegalStateException
> > > at
> > >
> >
>
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv
> > > letResponseWrapperInclude.java:109)
> > > at
> > >
> >
>
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav
> > > a:1143)
> > > at
> > >
> >
>
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
> > > java:679)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
> > > er.java:570)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
> > > .java:493)
> > > at
> > >
> >
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
> > > 18)
> > > at org.apache.jsp.test$jsp._jspService(test$jsp.java:67)
> > > at
> > >
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > at
> > >
> >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> > > va:202)
> > > at
> > >
> >
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
> > > at
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > > FilterChain.java:247)
> > > at
> > >
> >
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > > ain.java:193)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > > va:243)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 66)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > > at
> > >
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > > va:201)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 66)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > > at
> > >
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> > > )
> > > at
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 66)
> > > at
> > >
> >
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> > > java:170)
> > > at
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 64)
> > > at
> > >
> >
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
> > > )
> > > at
> > >
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 64)
> > > at
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by Jeff Kilbride <je...@kilbride.com>.
Nope. I tried it with *.doc files, too, and it still doesn't work. *.doc is
defined in web.xml.

Besides, it doesn't really make sense for MIME types to affect included
files, does it?

--jeff

----- Original Message -----
From: "August Detlefsen" <au...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, December 07, 2001 12:40 PM
Subject: Re: Unable to include *.sum files (Again)


> I am totally guessing, but maybe you have to define a MIME type for
> .sum files in your web.xml (and perhaps also where Apache configures
> MIME types?)?
>
> HTH,
> -August
>
> --- "Kusel, Jonathan J" <Ku...@scmb.co.za> wrote:
> >
> > Hi all,
> > I've mailed the follwoing to the tomcat users group but nobody has
> > responded
> > yet so I took the liberty of posting it again.
> >
> > Here's the message:
> > -------------------------------->
> >
> > I'm trying to include normal text files with ".sum"  extensions using
> > the
> > jsp:include directive:
> >    '<jsp:include page="testTxt.sum" flush="true" />'
> > but tomcat throws an exception(see bottom for the exception). When I
> > change
> > the file's extension to .txt for example it works, but the files that
> > I
> > wan't to include are generated by another program on a daily basis so
> > changing the extension is not an option.
> >
> > When I use the '<%@include file="testTxt.sum" %>' directive it works,
> > but I
> > need to use the <jsp:include> since the filenames are dynamically
> > generated.
> >
> > Is this a bug or am I doing something wrong? I'm using tomcat4.0 for
> > NT 4.0.
> >
> > THE STACKTRACE:
> > ----------------
> >
> > ApplicationDispatcher[/interestrates]: Servlet.service() for servlet
> > default
> > threw exception
> > java.lang.IllegalStateException
> > at
> >
>
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv
> > letResponseWrapperInclude.java:109)
> > at
> >
>
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav
> > a:1143)
> > at
> >
> org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
>
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
> > java:679)
> > at
> >
>
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
> > er.java:570)
> > at
> >
>
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
> > .java:493)
> > at
> >
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
> > 18)
> > at org.apache.jsp.test$jsp._jspService(test$jsp.java:67)
> > at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> > va:202)
> > at
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
> > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > FilterChain.java:247)
> > at
> >
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > ain.java:193)
> > at
> >
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > va:243)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > va:201)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> > at
> >
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> > )
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > at
> >
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> > java:170)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> > at
> >
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
> > )
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> > :163)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
> org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:371)
> > at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:424)
> > at java.lang.Thread.run(Thread.java:484)
> > StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw
> > exception
> > java.lang.IllegalStateException
> > java.lang.IllegalStateException
> > at
> >
>
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv
> > letResponseWrapperInclude.java:109)
> > at
> >
>
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav
> > a:1143)
> > at
> >
> org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
>
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
> > java:679)
> > at
> >
>
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
> > er.java:570)
> > at
> >
>
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
> > .java:493)
> > at
> >
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
> > 18)
> > at org.apache.jsp.test$jsp._jspService(test$jsp.java:67)
> > at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> > va:202)
> > at
> >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
> > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > FilterChain.java:247)
> > at
> >
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > ain.java:193)
> > at
> >
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > va:243)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > va:201)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > at
> >
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> > at
> >
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> > )
> > at
> >
> === message truncated ===
>
>
> __________________________________________________
> Do You Yahoo!?
> Send your FREE holiday greetings online!
> http://greetings.yahoo.com
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Unable to include *.sum files (Again)

Posted by August Detlefsen <au...@yahoo.com>.
I am totally guessing, but maybe you have to define a MIME type for
.sum files in your web.xml (and perhaps also where Apache configures
MIME types?)? 

HTH,
-August

--- "Kusel, Jonathan J" <Ku...@scmb.co.za> wrote:
> 
> Hi all,
> I've mailed the follwoing to the tomcat users group but nobody has
> responded
> yet so I took the liberty of posting it again.
> 
> Here's the message:
> -------------------------------->
> 
> I'm trying to include normal text files with ".sum"  extensions using
> the
> jsp:include directive:
>    '<jsp:include page="testTxt.sum" flush="true" />'
> but tomcat throws an exception(see bottom for the exception). When I
> change
> the file's extension to .txt for example it works, but the files that
> I
> wan't to include are generated by another program on a daily basis so
> changing the extension is not an option.
> 
> When I use the '<%@include file="testTxt.sum" %>' directive it works,
> but I
> need to use the <jsp:include> since the filenames are dynamically
> generated.
> 
> Is this a bug or am I doing something wrong? I'm using tomcat4.0 for
> NT 4.0.
> 
> THE STACKTRACE:
> ----------------
> 
> ApplicationDispatcher[/interestrates]: Servlet.service() for servlet
> default
> threw exception
> java.lang.IllegalStateException
> at
>
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv
> letResponseWrapperInclude.java:109)
> at
>
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav
> a:1143)
> at
>
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
> java:679)
> at
>
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
> er.java:570)
> at
>
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
> .java:493)
> at
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
> 18)
> at org.apache.jsp.test$jsp._jspService(test$jsp.java:67)
> at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> va:202)
> at
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
> at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:243)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:201)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> )
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> java:170)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 64)
> at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
> )
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 64)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> :163)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:371)
> at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:424)
> at java.lang.Thread.run(Thread.java:484)
> StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw
> exception
> java.lang.IllegalStateException
> java.lang.IllegalStateException
> at
>
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv
> letResponseWrapperInclude.java:109)
> at
>
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav
> a:1143)
> at
>
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
> java:679)
> at
>
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
> er.java:570)
> at
>
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
> .java:493)
> at
>
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
> 18)
> at org.apache.jsp.test$jsp._jspService(test$jsp.java:67)
> at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
> va:202)
> at
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
> at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> va:243)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> va:201)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> 66)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> )
> at
> 
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>