You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "nagesh.kumar" <na...@interglobetechnologies.com> on 2007/05/01 13:04:39 UTC

Jsp out to Persist

Hi All,

I have a scenario like I need to persist or get stream of generated output
JSP OUT PUT [HTML]

I have  flow like ACTION  >  JSP >  gives HTML out oput to browser

Now I need to persist this generated html from jsp to some file.

How can I close this 

Please give me a solution

Or 

How can I call this action > jsp with out HTTP also.

Thanks & Regards
Nagesh Reddy



DISCLAIMER:
The information in this e-mail is the property of InterGlobe and is confidential and privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and will be unlawful. If you receive this message in error, please notify the sender immediately and delete all copies of this message



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Jsp out to Persist

Posted by Lance <la...@marketpipe.com>.
Ah... this is simpler then, I thought you were recording pages as users 
were viewing them.
Do you need to be logged in to view the page?

If yes, check out commons-httpclient, which will maintin cookies for you
You will neeed to post to the login page then navigate to the page you 
want and save the inputStream() for the page
http://jakarta.apache.org/commons/httpclient/tutorial.html

If no, you can simple use a java.net.URL and openStream() to get a 
stream to the html (genereated by jsp).
http://java.sun.com/j2se/1.4.2/docs/api/java/net/URL.html

nagesh.kumar wrote:
> Thanks a lot buddy,
>
> I need to send a mail by using the same html generated by jsp  
>  just like your idea [save the file to the server]
>
> How can I implement this do u have any example where I can refer.
>
> Thanks & Regards
> Nagesh Reddy.
>
> -----Original Message-----
> From: Lance [mailto:lance.semmens@marketpipe.com] 
> Sent: Tuesday, May 01, 2007 4:52 PM
> To: Struts Users Mailing List
> Subject: Re: Jsp out to Persist
>
> Are you saving the file to the client or to the server?
>
> If you want the client to save the file, you can set the content disposition
> header... this will cause a file download dialog to appear
>     response.setHeader("content-disposition", "attachment;
> filename=someFileName.html");
>
> If you want to save the file to the server, you could use a
> javax.servlet.Filter which is mapped to the uri(s) that you want to keep a
> record of.
> You could wrap the resppnse in a custom ResponseWrapper The response wrapper
> overrides getOutputStream() and getWriter() so that they return objects that
> write to the file system and the wrapped response.
>
> Cheers,
> Lance,
>
> nagesh.kumar wrote:
>   
>> Hi All,
>>
>> I have a scenario like I need to persist or get stream of generated 
>> output JSP OUT PUT [HTML]
>>
>> I have  flow like ACTION  >  JSP >  gives HTML out oput to browser
>>
>> Now I need to persist this generated html from jsp to some file.
>>
>> How can I close this
>>
>> Please give me a solution
>>
>> Or
>>
>> How can I call this action > jsp with out HTTP also.
>>
>> Thanks & Regards
>> Nagesh Reddy
>>
>>
>>
>> DISCLAIMER:
>> The information in this e-mail is the property of InterGlobe and is 
>> confidential and privileged. It is intended solely for the addressee. 
>> Access to this email by anyone else is unauthorized. If you are not 
>> the intended recipient, any disclosure, copying, distribution or any 
>> action taken in reliance on it is prohibited and will be unlawful. If 
>> you receive this message in error, please notify the sender 
>> immediately and delete all copies of this message
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> DISCLAIMER:
> The information in this e-mail is the property of InterGlobe and is confidential and privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and will be unlawful. If you receive this message in error, please notify the sender immediately and delete all copies of this message
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Jsp out to Persist

Posted by "nagesh.kumar" <na...@interglobetechnologies.com>.
Thanks a lot buddy,

I need to send a mail by using the same html generated by jsp  
 just like your idea [save the file to the server]

How can I implement this do u have any example where I can refer.

Thanks & Regards
Nagesh Reddy.

-----Original Message-----
From: Lance [mailto:lance.semmens@marketpipe.com] 
Sent: Tuesday, May 01, 2007 4:52 PM
To: Struts Users Mailing List
Subject: Re: Jsp out to Persist

Are you saving the file to the client or to the server?

If you want the client to save the file, you can set the content disposition
header... this will cause a file download dialog to appear
    response.setHeader("content-disposition", "attachment;
filename=someFileName.html");

If you want to save the file to the server, you could use a
javax.servlet.Filter which is mapped to the uri(s) that you want to keep a
record of.
You could wrap the resppnse in a custom ResponseWrapper The response wrapper
overrides getOutputStream() and getWriter() so that they return objects that
write to the file system and the wrapped response.

Cheers,
Lance,

nagesh.kumar wrote:
> Hi All,
>
> I have a scenario like I need to persist or get stream of generated 
> output JSP OUT PUT [HTML]
>
> I have  flow like ACTION  >  JSP >  gives HTML out oput to browser
>
> Now I need to persist this generated html from jsp to some file.
>
> How can I close this
>
> Please give me a solution
>
> Or
>
> How can I call this action > jsp with out HTTP also.
>
> Thanks & Regards
> Nagesh Reddy
>
>
>
> DISCLAIMER:
> The information in this e-mail is the property of InterGlobe and is 
> confidential and privileged. It is intended solely for the addressee. 
> Access to this email by anyone else is unauthorized. If you are not 
> the intended recipient, any disclosure, copying, distribution or any 
> action taken in reliance on it is prohibited and will be unlawful. If 
> you receive this message in error, please notify the sender 
> immediately and delete all copies of this message
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


DISCLAIMER:
The information in this e-mail is the property of InterGlobe and is confidential and privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and will be unlawful. If you receive this message in error, please notify the sender immediately and delete all copies of this message



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Jsp out to Persist

Posted by Lance <la...@marketpipe.com>.
Are you saving the file to the client or to the server?

If you want the client to save the file, you can set the content 
disposition header... this will cause a file download dialog to appear
    response.setHeader("content-disposition", "attachment; 
filename=someFileName.html");

If you want to save the file to the server, you could use a 
javax.servlet.Filter which is mapped to the uri(s) that you want to keep 
a record of.
You could wrap the resppnse in a custom ResponseWrapper
The response wrapper overrides getOutputStream() and getWriter() so that 
they return objects that write to the file system and the wrapped response.

Cheers,
Lance,

nagesh.kumar wrote:
> Hi All,
>
> I have a scenario like I need to persist or get stream of generated output
> JSP OUT PUT [HTML]
>
> I have  flow like ACTION  >  JSP >  gives HTML out oput to browser
>
> Now I need to persist this generated html from jsp to some file.
>
> How can I close this 
>
> Please give me a solution
>
> Or 
>
> How can I call this action > jsp with out HTTP also.
>
> Thanks & Regards
> Nagesh Reddy
>
>
>
> DISCLAIMER:
> The information in this e-mail is the property of InterGlobe and is confidential and privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and will be unlawful. If you receive this message in error, please notify the sender immediately and delete all copies of this message
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org