You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by abhishek jain <ab...@gmail.com> on 2010/03/05 06:18:24 UTC
jsp out to a differnet outputstream
Hi guys,
I am not sure if it a direct struts question, if it is not pl pardon me and
let me know,
Is there a method in jsp / struts in which the output of a jsp page is
1. send to a file(saved in a file) , instead of going into browser response,
2. send to an email library,
the 1 is more important for me for the time.
Pl. let me know thanks,
--
Thanks and kind Regards,
Abhishek jain
RE: jsp out to a differnet outputstream
Posted by adam pinder <ap...@hotmail.co.uk>.
then create a new result type handler class, add into struts.xml and use that to handle file creation.
i've not done it myself, but there are result types for handling jasper reports etc.. so can't be too involved.
adam
> Date: Fri, 5 Mar 2010 14:57:07 +0530
> Subject: Re: jsp out to a differnet outputstream
> From: abhishek.netjain@gmail.com
> To: user@struts.apache.org
>
> Hi Adam,
> Thanks for replying, It is a file on server side,
> I could have written plain java code in JSP, but that will loose the benefit
> of jsp and also rework on my end, I am sure there must be a method to
> redirect the output of *out *to a file and not to STDOUT or so.
>
> thanks
> abhi
>
> On Fri, Mar 5, 2010 at 2:10 PM, adam pinder <ap...@hotmail.co.uk> wrote:
>
> >
> >
> >
> > is it a file on the client side or server side ?
> >
> >
> >
> > if client side, you can specify a result type in the struts.xml but the
> > user will be prompted to save the file as its a security risk to write it
> > without there confirmation.
> >
> >
> >
> > server side, just use plain java code in jsp to write and then do a page
> > redirect or return null.
> >
> >
> >
> > adam
> >
> >
> >
> > > Date: Fri, 5 Mar 2010 12:52:33 +0530
> > > Subject: Re: jsp out to a differnet outputstream
> > > From: abhishek.netjain@gmail.com
> > > To: user@struts.apache.org
> > >
> > > On Fri, Mar 5, 2010 at 11:05 AM, Dale Newfield <da...@newfield.org>
> > wrote:
> > >
> > > > abhishek jain wrote:
> > > >
> > > >> I am not sure if it a direct struts question, if it is not pl pardon
> > me
> > > >> and
> > > >> let me know,
> > > >>
> > > >
> > > > Maybe a filter in your web.xml?
> > > >
> > > > How are your pages put together? tiles? sitemesh?
> > > > Since those are already filters, you might see if those can do what you
> > > > want...
> > > >
> > > Hi,
> > > I am using Tiles.
> > > Can tiles do the work for me?
> > > thanks
> > > abhi
> >
> > _________________________________________________________________
> > We want to hear all your funny, exciting and crazy Hotmail stories. Tell us
> > now
> > http://clk.atdmt.com/UKM/go/195013117/direct/01/
> >
>
>
>
> --
> Thanks and kind Regards,
> Abhishek jain
> +91 9971376767
_________________________________________________________________
Send us your Hotmail stories and be featured in our newsletter
http://clk.atdmt.com/UKM/go/195013117/direct/01/
RE: jsp out to a differnet outputstream
Posted by adam pinder <ap...@hotmail.co.uk>.
implement this interface
com.opensymphony.xwork2.Result
to create your own result type.
> Date: Fri, 5 Mar 2010 14:57:07 +0530
> Subject: Re: jsp out to a differnet outputstream
> From: abhishek.netjain@gmail.com
> To: user@struts.apache.org
>
> Hi Adam,
> Thanks for replying, It is a file on server side,
> I could have written plain java code in JSP, but that will loose the benefit
> of jsp and also rework on my end, I am sure there must be a method to
> redirect the output of *out *to a file and not to STDOUT or so.
>
> thanks
> abhi
>
> On Fri, Mar 5, 2010 at 2:10 PM, adam pinder <ap...@hotmail.co.uk> wrote:
>
> >
> >
> >
> > is it a file on the client side or server side ?
> >
> >
> >
> > if client side, you can specify a result type in the struts.xml but the
> > user will be prompted to save the file as its a security risk to write it
> > without there confirmation.
> >
> >
> >
> > server side, just use plain java code in jsp to write and then do a page
> > redirect or return null.
> >
> >
> >
> > adam
> >
> >
> >
> > > Date: Fri, 5 Mar 2010 12:52:33 +0530
> > > Subject: Re: jsp out to a differnet outputstream
> > > From: abhishek.netjain@gmail.com
> > > To: user@struts.apache.org
> > >
> > > On Fri, Mar 5, 2010 at 11:05 AM, Dale Newfield <da...@newfield.org>
> > wrote:
> > >
> > > > abhishek jain wrote:
> > > >
> > > >> I am not sure if it a direct struts question, if it is not pl pardon
> > me
> > > >> and
> > > >> let me know,
> > > >>
> > > >
> > > > Maybe a filter in your web.xml?
> > > >
> > > > How are your pages put together? tiles? sitemesh?
> > > > Since those are already filters, you might see if those can do what you
> > > > want...
> > > >
> > > Hi,
> > > I am using Tiles.
> > > Can tiles do the work for me?
> > > thanks
> > > abhi
> >
> > _________________________________________________________________
> > We want to hear all your funny, exciting and crazy Hotmail stories. Tell us
> > now
> > http://clk.atdmt.com/UKM/go/195013117/direct/01/
> >
>
>
>
> --
> Thanks and kind Regards,
> Abhishek jain
> +91 9971376767
_________________________________________________________________
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/
Re: jsp out to a differnet outputstream
Posted by abhishek jain <ab...@gmail.com>.
Hi Adam,
Thanks for replying, It is a file on server side,
I could have written plain java code in JSP, but that will loose the benefit
of jsp and also rework on my end, I am sure there must be a method to
redirect the output of *out *to a file and not to STDOUT or so.
thanks
abhi
On Fri, Mar 5, 2010 at 2:10 PM, adam pinder <ap...@hotmail.co.uk> wrote:
>
>
>
> is it a file on the client side or server side ?
>
>
>
> if client side, you can specify a result type in the struts.xml but the
> user will be prompted to save the file as its a security risk to write it
> without there confirmation.
>
>
>
> server side, just use plain java code in jsp to write and then do a page
> redirect or return null.
>
>
>
> adam
>
>
>
> > Date: Fri, 5 Mar 2010 12:52:33 +0530
> > Subject: Re: jsp out to a differnet outputstream
> > From: abhishek.netjain@gmail.com
> > To: user@struts.apache.org
> >
> > On Fri, Mar 5, 2010 at 11:05 AM, Dale Newfield <da...@newfield.org>
> wrote:
> >
> > > abhishek jain wrote:
> > >
> > >> I am not sure if it a direct struts question, if it is not pl pardon
> me
> > >> and
> > >> let me know,
> > >>
> > >
> > > Maybe a filter in your web.xml?
> > >
> > > How are your pages put together? tiles? sitemesh?
> > > Since those are already filters, you might see if those can do what you
> > > want...
> > >
> > Hi,
> > I am using Tiles.
> > Can tiles do the work for me?
> > thanks
> > abhi
>
> _________________________________________________________________
> We want to hear all your funny, exciting and crazy Hotmail stories. Tell us
> now
> http://clk.atdmt.com/UKM/go/195013117/direct/01/
>
--
Thanks and kind Regards,
Abhishek jain
+91 9971376767
RE: jsp out to a differnet outputstream
Posted by adam pinder <ap...@hotmail.co.uk>.
is it a file on the client side or server side ?
if client side, you can specify a result type in the struts.xml but the user will be prompted to save the file as its a security risk to write it without there confirmation.
server side, just use plain java code in jsp to write and then do a page redirect or return null.
adam
> Date: Fri, 5 Mar 2010 12:52:33 +0530
> Subject: Re: jsp out to a differnet outputstream
> From: abhishek.netjain@gmail.com
> To: user@struts.apache.org
>
> On Fri, Mar 5, 2010 at 11:05 AM, Dale Newfield <da...@newfield.org> wrote:
>
> > abhishek jain wrote:
> >
> >> I am not sure if it a direct struts question, if it is not pl pardon me
> >> and
> >> let me know,
> >>
> >
> > Maybe a filter in your web.xml?
> >
> > How are your pages put together? tiles? sitemesh?
> > Since those are already filters, you might see if those can do what you
> > want...
> >
> Hi,
> I am using Tiles.
> Can tiles do the work for me?
> thanks
> abhi
_________________________________________________________________
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/
Re: jsp out to a differnet outputstream
Posted by abhishek jain <ab...@gmail.com>.
On Fri, Mar 5, 2010 at 11:05 AM, Dale Newfield <da...@newfield.org> wrote:
> abhishek jain wrote:
>
>> I am not sure if it a direct struts question, if it is not pl pardon me
>> and
>> let me know,
>>
>
> Maybe a filter in your web.xml?
>
> How are your pages put together? tiles? sitemesh?
> Since those are already filters, you might see if those can do what you
> want...
>
Hi,
I am using Tiles.
Can tiles do the work for me?
thanks
abhi
Re: jsp out to a differnet outputstream
Posted by Dale Newfield <da...@newfield.org>.
abhishek jain wrote:
> I am not sure if it a direct struts question, if it is not pl pardon me and
> let me know,
Maybe a filter in your web.xml?
How are your pages put together? tiles? sitemesh?
Since those are already filters, you might see if those can do what you
want...
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org