Re: save dynamic jsp content

2001-08-01 Thread Calvin Yu

The easiest way would be to write a client that makes a HTTP request to
the server and captures the HTML output that way.

Calvin


On 01 Aug 2001 13:40:58 -0400, Mustapha Essalihe wrote:
 
 Hi,
  I am new to struts. In my action class (perform) I want to run a jsp
page
 in background and save its content in  an html file. How Can i do that
in
 perfom method ?. After that i know how i will send this html file by
e-mail
 (usinj java smtp) and forward the user to an adequate location
(success).
 Thanks in adavance.
 Mustapha Essalihe
 





RE: save dynamic jsp content

2001-08-01 Thread Kevin McLain

This will get you an input stream containing the content for the resource. 

try {
Url url = new Url(PATH_TO_RESOURCE_HERE);
InputStream is = url.openStream();

// use input stream to get content to pass through SMTP session

} catch (MalformedURLException ignored) {
} catch (IOException ignored) {
} finally {
try { 
is.close(); 
}
catch (IOException ignored) {
}
}


-Original Message-
From: Calvin Yu [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 01, 2001 11:07 AM
To: [EMAIL PROTECTED]
Subject: Re: save dynamic jsp content


The easiest way would be to write a client that makes a HTTP request to
the server and captures the HTML output that way.

Calvin


On 01 Aug 2001 13:40:58 -0400, Mustapha Essalihe wrote:
 
 Hi,
  I am new to struts. In my action class (perform) I want to run a jsp
page
 in background and save its content in  an html file. How Can i do that
in
 perfom method ?. After that i know how i will send this html file by
e-mail
 (usinj java smtp) and forward the user to an adequate location
(success).
 Thanks in adavance.
 Mustapha Essalihe
 





Re: save dynamic jsp content

2001-08-01 Thread Chris Nokes

An eaiser way may be to create a BodyTagSupport to capture the output in the
doAfterBody method and send it to the mail input stream or write to the
file
system first if desired.  This doesn't require an extra network call and
thread.

Chris

- Original Message -
From: Calvin Yu [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 01, 2001 1:06 PM
Subject: Re: save dynamic jsp content


The easiest way would be to write a client that makes a HTTP request to
the server and captures the HTML output that way.

Calvin


On 01 Aug 2001 13:40:58 -0400, Mustapha Essalihe wrote:

 Hi,
  I am new to struts. In my action class (perform) I want to run a jsp
page
 in background and save its content in  an html file. How Can i do that
in
 perfom method ?. After that i know how i will send this html file by
e-mail
 (usinj java smtp) and forward the user to an adequate location
(success).
 Thanks in adavance.
 Mustapha Essalihe







RE: save dynamic jsp content

2001-08-01 Thread Kapila, Ranjit

Does the bean:include tag solve your problem? Per the Struts
documentation, it can capture the dynamic response and makes it available as
a bean.

See http://jakarta.apache.org/struts/struts-bean.html#include

Hope that helps.

Ranjit


-Original Message-
From: Calvin Yu [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 01, 2001 3:45 PM
To: [EMAIL PROTECTED]
Subject: Re: save dynamic jsp content



Fantastic idea!  This would be an easier way.

Calvin


On 01 Aug 2001 14:31:44 -0500, Chris Nokes wrote:
 An eaiser way may be to create a BodyTagSupport to capture the output
in the
 doAfterBody method and send it to the mail input stream or write to
the
 file
 system first if desired.  This doesn't require an extra network call
and
 thread.
 
 Chris
 
 - Original Message -
 From: Calvin Yu [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, August 01, 2001 1:06 PM
 Subject: Re: save dynamic jsp content
 
 
 The easiest way would be to write a client that makes a HTTP request
to
 the server and captures the HTML output that way.
 
 Calvin
 
 
 On 01 Aug 2001 13:40:58 -0400, Mustapha Essalihe wrote:
 
  Hi,
   I am new to struts. In my action class (perform) I want to run a
jsp
 page
  in background and save its content in  an html file. How Can i do
that
 in
  perfom method ?. After that i know how i will send this html file by
 e-mail
  (usinj java smtp) and forward the user to an adequate location
 (success).
  Thanks in adavance.
  Mustapha Essalihe