Yeah. Having many options is not always a good thing. Please note that
request targets are not specifically meant for day-to-day end user
usage. They are meant to more clearly define the request processing,
and to have extensibility form a framework's perspective, e.g. to
implement new things like Ajax etc. You may use request targets for
your own purposes of course, and that is not bad practice either, but
my preference would be to handle things like that like resources. Then
you either have requests components (like pages and their variants
like bookmarkable pages etc) or to resources (including variants like
shared resources etc).

Eelco


On 3/22/06, Mats Norén <[EMAIL PROTECTED]> wrote:
> Even better. Thanks for the tip. There are so many options it's quite
> easy to get confused :)
>
> Mats
>
> On 3/22/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > You don't need a PageRequestTarget as the page doesn't add any value
> > here. I would use ResourceStreamRequestTarget and provide your content
> > wrapped in a IResourceStream.
> >
> > Eelco
> >
> > On 3/22/06, Mats Norén <[EMAIL PROTECTED]> wrote:
> > > On 3/21/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > > > why not just push a download request target into the request cycle? it 
> > > > works
> > > > for 1.2. search this list for "excel"
> > >
> > > So if I were to use the request target approach I would do:
> > >
> > > protected void onSubmit() {
> > >      getRequestCycle().setRequestTarget(new PageRequestTarget(new
> > >   ExportPage(data)););
> > >  WebResponse wr=(WebResponse)getResponse();
> > >  wr.setContentType("excel/ms-excel; name=" + msExcelFilename);
> > >  wr.setHeader("content-disposition",
> > >            "attachment;filename=" + msExcelFilename);
> > > }
> > >
> > >
> > >
> > >
> > >
> > > >
> > > > -Igor
> > > >
> > > >
> > > >
> > > > On 3/21/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > > > > That has to do with the page render strategy. A way around this is to
> > > > > change that strategy, but a much better solution is to make your PO
> > > > > worksheet a resource instead of a page. Please check out
> > > > > wicket-stuff's JasperReports integration for an idea how to do this.
> > > > >
> > > > > Eelco
> > > > >
> > > > > On 3/21/06, Mats Norén <[EMAIL PROTECTED]> wrote:
> > > > > > Hi,
> > > > > > I'm trying to export a POI worksheet as a download link in my wicket
> > > > page.
> > > > > > The link sets the responsepage to a download page in which
> > > > > > trying to get the outputbuffer to write to. Only problem is that I
> > > > > > keep getting this:
> > > > > > "java.lang.UnsupportedOperationException: Cannot get
> > > > output stream on
> > > > > > BufferedResponse"
> > > > > >
> > > > > > I looked at the  code from the wicket-examples display-tag export 
> > > > > > the
> > > > > > only thing I do differently is the way the page is created.
> > > > > >
> > > > > > The weird thing is that I only get it if I instantiate my response 
> > > > > > like:
> > > > > > setResponsePage(new DownloadPage(data));
> > > > > >
> > > > > > if I do
> > > > > > setResponsePage(DownloadPage.class) it behaves correctly...
> > > > > >
> > > > > > I need to be able to pass data into the class...what am I missing 
> > > > > > here?
> > > > > >
> > > > > > /Mats
> > > > > >
> > > > > >
> > > > > > -------------------------------------------------------
> > > > > > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > > > language
> > > > > > that extends applications into web and mobile media. Attend the live
> > > > webcast
> > > > > > and join the prime developer group breaking into this new coding
> > > > territory!
> > > > > >
> > > > http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> > > > > > _______________________________________________
> > > > > > Wicket-user mailing list
> > > > > > Wicket-user@lists.sourceforge.net
> > > > > >
> > > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > > >
> > > > >
> > > > >
> > > > > -------------------------------------------------------
> > > > > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > > > language
> > > > > that extends applications into web and mobile media. Attend the live
> > > > webcast
> > > > > and join the prime developer group breaking into this new coding
> > > > territory!
> > > > >
> > > > http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> > > > > _______________________________________________
> > > > > Wicket-user mailing list
> > > > > Wicket-user@lists.sourceforge.net
> > > > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > >
> > > >
> > > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by xPML, a groundbreaking scripting 
> > > language
> > > that extends applications into web and mobile media. Attend the live 
> > > webcast
> > > and join the prime developer group breaking into this new coding 
> > > territory!
> > > http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> > > _______________________________________________
> > > Wicket-user mailing list
> > > Wicket-user@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> > that extends applications into web and mobile media. Attend the live webcast
> > and join the prime developer group breaking into this new coding territory!
> > http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to