tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: How can I refresh tomcat in the java code?
Date Fri, 04 Apr 2008 13:32:10 GMT
Hash: SHA1


Guilherme Orioli wrote:
| Yes, it's an EJB managed by the JSF config faces-config.xml . Should I
use a
| different servlet to get the result wanted?

The problem is that you are using an EJB to manipulate the HTTP request
and response. You shouldn't do that. Fill the EJB with whatever data you
need from the request, tell it to generate the PDF, and then ask it
where the new PDF was written on the disk (or, you could even ask for an
InputStream to it, if you want to hide the location from the servlet).

The servlet should do all the work with the request and response. Get
that stuff out of your EJB. It'll be a lot easier to test that way.

| Is this code right, i mean, should it show the download dialog (or
even  the
| PDF screen).

If you always want to show a download dialog, you'll need to set a few
new headers. Search the web for "Content-Disposition" and "attachment".
You'll find stuff like this:

Otherwise, the PDF will be displayed in the browser's content ares
instead of being downloaded (unless the user chooses "Save Page As..."
from the file menu, of course).

- -chris
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message