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 Thu, 03 Apr 2008 17:10:19 GMT
Hash: SHA1


Guilherme Orioli wrote:

| Everyone recommended me to generate it and send it as a response.
| If that's the only option, I can accept that. If there's a way to refresh
| the content under tomcat server folder, it would be better.

There's no way that I know, short of reloading the entire webapp (which
is probably no what you want to do).

Another option would be to generate the content into a directory outside
your webapp (which is a good idea, anyway, since reloading the webapp
from a WAR would probably delete your generated content) and serve the
files yourself using a simple servlet that serves files out of a
particular directory.

There is full code for such a servlet that was posted (by me!) to the
list within the last 7 days or so with the subject "displaying an image
from outside the webapps directory". Check it out.

| The problem with the recommended option is: It doesn't send the
content to be
| downloaded.

It should be. You must have something else going on that is not working.

| The system.out was just a test to see if the file was generated correctly.
| It seems to be, since it prints tons of unknown chars. ^^

Well, what did you expect? ;)

| What this code I sent previously tries to do is:
| 1) Generate the pdf report (working fine)
| 2) Create a ByteArrayOutputStream with it (working fine)
| 3) Show it to be downloaded by the user (not working)

Which browser? Displaying in the browser window, or forcing a download?
It could even be a browser issue, especially if you are using Adobe's
PDF plug-in and Mozilla Firefox -- they don't play well together for
some reason.

| This code is located on a managed bean. The method is invoked when a
| h:commandButton is pressed. That's why I return a String.

Ugh. Do you mean EJB? <sigh>

| Hope you guys can help me now.

I'm sure we can, but it might take some time. Be patient with us ;)

| Sorry for the English.

Your English is just fine. I hope we're not using too many phrases that
don't translate very well.

- -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