You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alex <al...@go.ro> on 2002/06/21 11:10:00 UTC
Re[2]: AW: AW: set content type to text/pdf
Hello Liam,
I've inserted into the web.xml file these lines:
<servlet-mapping>
<servlet-name>Tiparire</servlet-name>
<url-pattern>Tiparire.pdf</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Tiparire</servlet-name>
<servlet-class>Tiparire</servlet-class>
</servlet>
Tiparire.class is not part of any package.
Tomcat starts ok, but, when i'm trying to access the location
"servlet/Tiparire.pdf", it says:
"The requested resource (/servlet/Tiparire.pdf) is not
available"
Where is the problem ?
Alex.
Friday, June 21, 2002, 11:56:32 AM, you wrote:
LM> You might need to declare the servlet from within a servlet element like
LM> this as well:
LM> |<servlet-mapping>
LM> <servlet-name>Tiparire</servlet-name>
LM> <url-pattern>Tiparire.pdf</url-pattern>
LM> </servlet-mapping>
LM> <servlet>
LM> <servlet-name>Tiparire</servlet-name>
LM> <servlet-class>Tiparire</servlet-class>
LM> </servlet>
LM> |
LM> servlet-class is actually the fully qualified class name (with package
LM> name etc), just in case it's part of a package.
LM> Liam Morley
LM> Alex wrote:
>>Hello Ralph,
>>
>> I've modified web.xml from ROOT\WEB-INF, and i've added
>> something like this:
>> <servlet-mapping>
>> <servlet-name>Tiparire</servlet-name>
>> <url-pattern>Tiparire.pdf</url-pattern>
>> </servlet-mapping>
>> My servlet is called Tiparire.class and is located into
>> ROOT\WEB-INF\classes
>> But, when i start tomcat, it says:
>> ERROR reading java.io.ByteArrayInputStream@4e280c
>> At Line 11 /web-app/servlet-mapping/
>> What is wrong ?
>>
>> Alex.
>>
>>Friday, June 21, 2002, 11:01:10 AM, you wrote:
>>
>>RE> It's possible to configure tomcat to let you request
>>RE> /servlet/Tiparire/text.pdf and to get /servlet/Tiparire
>>RE> executed. I haven't tried by now to do something like
>>RE> that so can't give you much more help.
>>
>>RE> Maybe something like this should do the trick:
>>
>>RE> <servlet-mapping>
>>RE> <servlet-name>Tiparire</servlet-name>
>>RE> <url-pattern>*.pdf</url-pattern>
>>RE> </servlet-mapping>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: AW: AW: set content type to text/pdf
Posted by Ben Walding <to...@walding.com>.
Digging back into the dark cavern that is "trying to get IE to work with
a spec complying application"
(from which I have emerged and no longer care about)...
I believe you might be able to go....
http://<server>:8080/servlet/pdfservlet?thisisnotanarg.pdf
This may confuse IE into giving you what it should have given you in the
first place.
I also vaguely recall that IE is VERY particular about the headers that
you send... the following are headers that I sent out of an app I was
using with PDF. Worth trying, but not worth relying on!
response.addHeader(
"Content-Type",
"application/pdf; name=" + (char) 34 + outfilename + (char) 34);
response.addHeader(
"Content-Disposition",
"inline; filename=" + (char) 34 + outfilename + (char) 34);
Enjoy!
(Don't question the use of (char) 34, I borrowed it from elsewhere
without thinking!)
Now when someone can explain why IE displays PNG with a different color
than what they really are (no alpha channels or anything silly like
that), then I'll be happy. Well... no I won't, but I might be bemused!
Constantin Wolber wrote:
>Freitag, 21. Juni 2002 11:10 schrieb Alex:
>
>
>> Tiparire.class is not part of any package.
>> Tomcat starts ok, but, when i'm trying to access the location
>> "servlet/Tiparire.pdf", it says:
>>
>>
>
>Hi,
>
>cause your using a servlet Mapping and your servlet is in the ROOT
>Context you have to leave the servlet in servlet/Tiparire.pdf away
>
>You should reach your servlet by connecting to this URL
>
>http://yourserver:8080/Tiparire.pdf
>
>Cu
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Re[2]: AW: AW: set content type to text/pdf
Posted by Constantin Wolber <co...@cwolber.de>.
Freitag, 21. Juni 2002 11:10 schrieb Alex:
> Tiparire.class is not part of any package.
> Tomcat starts ok, but, when i'm trying to access the location
> "servlet/Tiparire.pdf", it says:
Hi,
cause your using a servlet Mapping and your servlet is in the ROOT
Context you have to leave the servlet in servlet/Tiparire.pdf away
You should reach your servlet by connecting to this URL
http://yourserver:8080/Tiparire.pdf
Cu
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>