Re: How Do I Turn A JSP Screen Into A File?
- From: Andrea Desole <news@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 20 Oct 2005 14:31:28 +0200
MattC wrote:
One way is to just build a file programmatically totally separate from the jsp. That will work but certainly doesn't seem to be an easy way and in addition I will have to keep the data file in sync with any changes made to the jsp.
Is there an easier way to accomplish this by using the http response or some other cleaver approach?
you are probably on the right way when you talk about building a file programmatically. This is what you can do.
You use a servlet filter. In the filter you replace the original servlet response with your own response wrapper. The getWriter() method of your wrapper will give your own PrintWriter, which will write everything to the PrintWriter of the original reponse (wrapped by your wrapper) and to your separate file.
Of course, if you do this you will lose all the information about stylesheets and pictures, which are on different files. You will just write the html coming from your jsp.
.
- Prev by Date: Java (swing heavy) performance with XP SP2
- Next by Date: Re: Setting up a URL resource in Tomcat JNDI
- Previous by thread: Re: How Do I Turn A JSP Screen Into A File?
- Next by thread: Java (swing heavy) performance with XP SP2
- Index(es):