You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Brandon Goodin <ma...@phase.ws> on 2001/11/02 03:34:20 UTC
Capturing an outgoing response.
Is it possible to capture the html page that is generated by a jsp page
before it is sent to the client who requested it?
Brandon Goodin
Phase Communications
P (406)862-2245
F (406)862-0354
http://www.phase.ws
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Capturing an outgoing response.
Posted by Adam <ad...@getcare.com>.
Another way is to proxy it yourself. This may or may not work if you
are dependent on user state. Basically, you server code plays the role
of the web browser ala wget.
(not sure if the following code is correct. Let the buyer beware)
URL url = new URL(pageToCache);
String pageToCacheContent = (string)url.getContent();
If you are dependant on user state, You may need to do some additional
hacking
Scott Sayles wrote:
>There are probably numerous ways this can be done. If you just want to
>easily capture the output from a single page, you could simply make that
>page an included page and use the <bean:include> tag to capture it's
>output. i.e. make the requested page include the real page via the
><bean:include> tag.
>
>For example:
>
>----- page1.jsp -----
>
><bean:include id="page2Output" page="page2.jsp"/>
>
><%
>writeFile(page2Output); //or however else you're going to do this
>%>
>
><bean:write name="page2Output"/>
>
>---------------------
>
>Where page2.jsp is what you actually want to display to the user.
>
>
>This is not the best solution in all cases, but may suffice for your
>needs.
>
>Scott
>
>
>On Fri, 2001-11-02 at 01:20, Brandon Goodin wrote:
>
>>I need it to capture the returning html/page on the server side. For
>>example, a client makes a request to a jsp page on my website and an an html
>>page is returned. Is there a way to capture the html being returned to a
>>file on the server side before it is sent to the client or as it is heading
>>out. I would like to capture this output to a static file.
>>
>>Brandon Goodin
>>Phase Communications
>>P (406)862-2245
>>F (406)862-0354
>>http://www.phase.ws
>>
>>
>>-----Original Message-----
>>From: martin.cooper@tumbleweed.com [mailto:martin.cooper@tumbleweed.com]
>>Sent: Thursday, November 01, 2001 11:00 PM
>>To: Struts Users Mailing List; mail@phase.ws
>>Subject: Re: Capturing an outgoing response.
>>
>>
>>You might want to take a look at WebDebug:
>>
>>http://www.cyberclip.com/webdebug/
>>
>>--
>>Martin Cooper
>>
>>
>>----- Original Message -----
>>From: "Brandon Goodin" <ma...@phase.ws>
>>To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
>>Sent: Thursday, November 01, 2001 6:34 PM
>>Subject: Capturing an outgoing response.
>>
>>
>>>Is it possible to capture the html page that is generated by a jsp page
>>>before it is sent to the client who requested it?
>>>
>>>Brandon Goodin
>>>Phase Communications
>>>P (406)862-2245
>>>F (406)862-0354
>>>http://www.phase.ws
>>>
>>>
>>>
>>>
>>>--
>>>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>
>>
>>
>>
>>
>>--
>>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>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Capturing an outgoing response.
Posted by Scott Sayles <ss...@fgm.com>.
There are probably numerous ways this can be done. If you just want to
easily capture the output from a single page, you could simply make that
page an included page and use the <bean:include> tag to capture it's
output. i.e. make the requested page include the real page via the
<bean:include> tag.
For example:
----- page1.jsp -----
<bean:include id="page2Output" page="page2.jsp"/>
<%
writeFile(page2Output); //or however else you're going to do this
%>
<bean:write name="page2Output"/>
---------------------
Where page2.jsp is what you actually want to display to the user.
This is not the best solution in all cases, but may suffice for your
needs.
Scott
On Fri, 2001-11-02 at 01:20, Brandon Goodin wrote:
> I need it to capture the returning html/page on the server side. For
> example, a client makes a request to a jsp page on my website and an an html
> page is returned. Is there a way to capture the html being returned to a
> file on the server side before it is sent to the client or as it is heading
> out. I would like to capture this output to a static file.
>
> Brandon Goodin
> Phase Communications
> P (406)862-2245
> F (406)862-0354
> http://www.phase.ws
>
>
> -----Original Message-----
> From: martin.cooper@tumbleweed.com [mailto:martin.cooper@tumbleweed.com]
> Sent: Thursday, November 01, 2001 11:00 PM
> To: Struts Users Mailing List; mail@phase.ws
> Subject: Re: Capturing an outgoing response.
>
>
> You might want to take a look at WebDebug:
>
> http://www.cyberclip.com/webdebug/
>
> --
> Martin Cooper
>
>
> ----- Original Message -----
> From: "Brandon Goodin" <ma...@phase.ws>
> To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> Sent: Thursday, November 01, 2001 6:34 PM
> Subject: Capturing an outgoing response.
>
>
> > Is it possible to capture the html page that is generated by a jsp page
> > before it is sent to the client who requested it?
> >
> > Brandon Goodin
> > Phase Communications
> > P (406)862-2245
> > F (406)862-0354
> > http://www.phase.ws
> >
> >
> >
> >
> > --
> > 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>
>
>
>
>
> --
> 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: Capturing an outgoing response.
Posted by Brandon Goodin <ma...@phase.ws>.
I need it to capture the returning html/page on the server side. For
example, a client makes a request to a jsp page on my website and an an html
page is returned. Is there a way to capture the html being returned to a
file on the server side before it is sent to the client or as it is heading
out. I would like to capture this output to a static file.
Brandon Goodin
Phase Communications
P (406)862-2245
F (406)862-0354
http://www.phase.ws
-----Original Message-----
From: martin.cooper@tumbleweed.com [mailto:martin.cooper@tumbleweed.com]
Sent: Thursday, November 01, 2001 11:00 PM
To: Struts Users Mailing List; mail@phase.ws
Subject: Re: Capturing an outgoing response.
You might want to take a look at WebDebug:
http://www.cyberclip.com/webdebug/
--
Martin Cooper
----- Original Message -----
From: "Brandon Goodin" <ma...@phase.ws>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Thursday, November 01, 2001 6:34 PM
Subject: Capturing an outgoing response.
> Is it possible to capture the html page that is generated by a jsp page
> before it is sent to the client who requested it?
>
> Brandon Goodin
> Phase Communications
> P (406)862-2245
> F (406)862-0354
> http://www.phase.ws
>
>
>
>
> --
> 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>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Capturing an outgoing response.
Posted by ma...@tumbleweed.com.
You might want to take a look at WebDebug:
http://www.cyberclip.com/webdebug/
--
Martin Cooper
----- Original Message -----
From: "Brandon Goodin" <ma...@phase.ws>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Thursday, November 01, 2001 6:34 PM
Subject: Capturing an outgoing response.
> Is it possible to capture the html page that is generated by a jsp page
> before it is sent to the client who requested it?
>
> Brandon Goodin
> Phase Communications
> P (406)862-2245
> F (406)862-0354
> http://www.phase.ws
>
>
>
>
> --
> 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: Capturing an outgoing response.
Posted by Sandeep Takhar <sa...@yahoo.com>.
I believe there is also a tag that struts uses that
can take the output servlet/jsp and place it in a
bean. If you look at the code for this tag you will
see how they get the output of a servlet and place it
in a bean. This should work for any type of output.
Unfortunately I don't have the code with me -- or
which tag it is, but I remember it as being an xml/xsl
tag that could be used to reference a url and placing
the output of that url to a bean. The idea being that
this bean could then be used as a starting point for
an xsl transform.
- Sandeep
--- Erik Hatcher
<ja...@ehatchersolutions.com> wrote:
> Are you running a Servlet 2.3 compliant app. server?
> If so, Filters are
> what you are looking for. If not, you could add
> some scriptlet to the end
> of each JSP (perhaps?) that could "post-process" the
> response before it is
> finalized.
>
> Erik
>
>
> ----- Original Message -----
> From: "Brandon Goodin" <ma...@phase.ws>
> To: "'Struts Users Mailing List'"
> <st...@jakarta.apache.org>
> Sent: Thursday, November 01, 2001 9:34 PM
> Subject: Capturing an outgoing response.
>
>
> > Is it possible to capture the html page that is
> generated by a jsp page
> > before it is sent to the client who requested it?
> >
> > Brandon Goodin
> > Phase Communications
> > P (406)862-2245
> > F (406)862-0354
> > http://www.phase.ws
> >
> >
> >
> >
> > --
> > 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>
>
__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Capturing an outgoing response.
Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Are you running a Servlet 2.3 compliant app. server? If so, Filters are
what you are looking for. If not, you could add some scriptlet to the end
of each JSP (perhaps?) that could "post-process" the response before it is
finalized.
Erik
----- Original Message -----
From: "Brandon Goodin" <ma...@phase.ws>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Thursday, November 01, 2001 9:34 PM
Subject: Capturing an outgoing response.
> Is it possible to capture the html page that is generated by a jsp page
> before it is sent to the client who requested it?
>
> Brandon Goodin
> Phase Communications
> P (406)862-2245
> F (406)862-0354
> http://www.phase.ws
>
>
>
>
> --
> 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>