You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Luca Provenzani <eu...@gmail.com> on 2009/03/05 15:21:55 UTC

ResourceLink, IE and https

Hi all

This is my situation:
 i've a ResourceLink based on a JasperReport Resource(DynamicWebResource )
and all is ok until i use http.
But if the web server uses https IE can't download the file.

i searched in the web but i 've found only an e-mail with similar problem (
http://www.nabble.com/Download-Link-Problem-td14693760.html#a14693760),
 but no answer!

Someone can help?

Regards

Luca

Re: ResourceLink, IE and https

Posted by Luca Provenzani <eu...@gmail.com>.
OK it's all ok
i just move the code from the onclick to "onmousedown"
AjaxFormSubmitBehavior.

and now all work fine!

a big thank Jonas!

Luca

2009/3/5 Luca Provenzani <eu...@gmail.com>

> sorry i wrote a wrong thing...
> the result is NOT ever the same, but is the report with the previous
> parameters.
> I try to explain better:
> i've a form that determines the report's prameters. On ResourceLink, i
> added a "onmousedown" AjaxFormSubmitBehavior to submit the parameter and
> calculate other. Then into the onclick of ResourceLink i update th resource
> parameter.
>
> the source:
>
> *        rXlsLnk = new ResourceLink("lnkReport", xlsResource){
>             private static final long serialVersionUID = 1L;
>
>             @Override
>             public void onClick() {
>                 HashMap<String, String> par = new HashMap<String,
> String>();
>                 par.put("myWhere", myWhere);
>
>                 xlsResource.setReportParameters(par);
>
>                 super.onClick();
>             }
>
>
>
>         };
>
>
>
>         rXlsLnk.add(new AjaxFormSubmitBehavior("onmousedown") {
>             private static final long serialVersionUID = 1L;
>
>             @Override
>             protected void onSubmit(AjaxRequestTarget target) {
>                 myWhere = "WHERE
> iscr.SISSIONE_COD_SCUOLA='"+MySession.getSessesion().getOperatore().getSissioneScuole().getCodMec()+"'"
> +
>                 " AND iscr.FS_ISCR_AS='"+iscrFilter.getAnnoScolastico()+"'
> ";
>
>                 if(iscrFilter.getPlessoId()!=null &&
> !iscrFilter.getPlessoId().equals("-1"))
> ...
> etc etc
> ....
>                    }
>                     else
>                     {
>                       }
>                 }
>             }
>
>             @Override
>             protected void onError(AjaxRequestTarget target) {
>                 myWhere = "WHERE 1=0";
>                 target.addComponent(feedbackPanel);
>             }
>         });*
>
> The first time i download the report i obtain an empty report, because
> empty parameters. The second time i obtained the report with th first submit
> parameter end then and then...
>
> can you help?
>
> thanks a lot
>
>
> Luca
>
>
> 2009/3/5 Jonas <ba...@gmail.com>
>
>> If it is the browser that caches the report, you can work around this
>> by adding something random to the url generated
>> by ResourceLink#getUrl, similar to what's done in NonCachingImage.
>>
>> urlFor(IResourceListener.INTERFACE) + "&wicket:antiCache=" +
>> System.currentTimeMillis()
>>
>> Unfortunatly, ResourceLink#getUrl is final, so you'll probably have to
>> create
>> your own Link subclass similar to ResourceLink
>>
>> On Thu, Mar 5, 2009 at 4:33 PM, Luca Provenzani <eu...@gmail.com>
>> wrote:
>> > in this way it works, but how can i refresh the report when parameter is
>> > changed?
>> >
>> > Until now i change parameter into the onclick of the ResourceLink, but
>> now
>> > the resource is cached...and then the result report is ever the same..
>> >
>> > thanks
>> > Luca
>> >
>> > 2009/3/5 Jonas <ba...@gmail.com>
>> >
>> >> Does it work if you set your Resource setCacheable(true)?
>> >>
>> >> On Thu, Mar 5, 2009 at 3:21 PM, Luca Provenzani <eu...@gmail.com>
>> >> wrote:
>> >> > Hi all
>> >> >
>> >> > This is my situation:
>> >> >  i've a ResourceLink based on a JasperReport
>> Resource(DynamicWebResource
>> >> )
>> >> > and all is ok until i use http.
>> >> > But if the web server uses https IE can't download the file.
>> >> >
>> >> > i searched in the web but i 've found only an e-mail with similar
>> problem
>> >> (
>> >> >
>> http://www.nabble.com/Download-Link-Problem-td14693760.html#a14693760),
>> >> >  but no answer!
>> >> >
>> >> > Someone can help?
>> >> >
>> >> > Regards
>> >> >
>> >> > Luca
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

Re: ResourceLink, IE and https

Posted by Jonas <ba...@gmail.com>.
Looking at ResourceLink#onResourceRequested, I see the resource is
delivered before
#onClick is called, so whatever you're doing in onClick is too late to
have any influence
on the report generation.

On Thu, Mar 5, 2009 at 4:52 PM, Luca Provenzani <eu...@gmail.com> wrote:
> sorry i wrote a wrong thing...
> the result is NOT ever the same, but is the report with the previous
> parameters.
> I try to explain better:
> i've a form that determines the report's prameters. On ResourceLink, i added
> a "onmousedown" AjaxFormSubmitBehavior to submit the parameter and calculate
> other. Then into the onclick of ResourceLink i update th resource parameter.
>
> the source:
>
> *        rXlsLnk = new ResourceLink("lnkReport", xlsResource){
>            private static final long serialVersionUID = 1L;
>
>            @Override
>            public void onClick() {
>                HashMap<String, String> par = new HashMap<String, String>();
>                par.put("myWhere", myWhere);
>
>                xlsResource.setReportParameters(par);
>
>                super.onClick();
>            }
>
>
>
>        };
>
>
>
>        rXlsLnk.add(new AjaxFormSubmitBehavior("onmousedown") {
>            private static final long serialVersionUID = 1L;
>
>            @Override
>            protected void onSubmit(AjaxRequestTarget target) {
>                myWhere = "WHERE
> iscr.SISSIONE_COD_SCUOLA='"+MySession.getSessesion().getOperatore().getSissioneScuole().getCodMec()+"'"
> +
>                " AND iscr.FS_ISCR_AS='"+iscrFilter.getAnnoScolastico()+"'
> ";
>
>                if(iscrFilter.getPlessoId()!=null &&
> !iscrFilter.getPlessoId().equals("-1"))
> ...
> etc etc
> ....
>                   }
>                    else
>                    {
>                      }
>                }
>            }
>
>            @Override
>            protected void onError(AjaxRequestTarget target) {
>                myWhere = "WHERE 1=0";
>                target.addComponent(feedbackPanel);
>            }
>        });*
>
> The first time i download the report i obtain an empty report, because empty
> parameters. The second time i obtained the report with th first submit
> parameter end then and then...
>
> can you help?
>
> thanks a lot
>
> Luca
>
>
> 2009/3/5 Jonas <ba...@gmail.com>
>
>> If it is the browser that caches the report, you can work around this
>> by adding something random to the url generated
>> by ResourceLink#getUrl, similar to what's done in NonCachingImage.
>>
>> urlFor(IResourceListener.INTERFACE) + "&wicket:antiCache=" +
>> System.currentTimeMillis()
>>
>> Unfortunatly, ResourceLink#getUrl is final, so you'll probably have to
>> create
>> your own Link subclass similar to ResourceLink
>>
>> On Thu, Mar 5, 2009 at 4:33 PM, Luca Provenzani <eu...@gmail.com>
>> wrote:
>> > in this way it works, but how can i refresh the report when parameter is
>> > changed?
>> >
>> > Until now i change parameter into the onclick of the ResourceLink, but
>> now
>> > the resource is cached...and then the result report is ever the same..
>> >
>> > thanks
>> > Luca
>> >
>> > 2009/3/5 Jonas <ba...@gmail.com>
>> >
>> >> Does it work if you set your Resource setCacheable(true)?
>> >>
>> >> On Thu, Mar 5, 2009 at 3:21 PM, Luca Provenzani <eu...@gmail.com>
>> >> wrote:
>> >> > Hi all
>> >> >
>> >> > This is my situation:
>> >> >  i've a ResourceLink based on a JasperReport
>> Resource(DynamicWebResource
>> >> )
>> >> > and all is ok until i use http.
>> >> > But if the web server uses https IE can't download the file.
>> >> >
>> >> > i searched in the web but i 've found only an e-mail with similar
>> problem
>> >> (
>> >> > http://www.nabble.com/Download-Link-Problem-td14693760.html#a14693760
>> ),
>> >> >  but no answer!
>> >> >
>> >> > Someone can help?
>> >> >
>> >> > Regards
>> >> >
>> >> > Luca
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: ResourceLink, IE and https

Posted by Luca Provenzani <eu...@gmail.com>.
sorry i wrote a wrong thing...
the result is NOT ever the same, but is the report with the previous
parameters.
I try to explain better:
i've a form that determines the report's prameters. On ResourceLink, i added
a "onmousedown" AjaxFormSubmitBehavior to submit the parameter and calculate
other. Then into the onclick of ResourceLink i update th resource parameter.

the source:

*        rXlsLnk = new ResourceLink("lnkReport", xlsResource){
            private static final long serialVersionUID = 1L;

            @Override
            public void onClick() {
                HashMap<String, String> par = new HashMap<String, String>();
                par.put("myWhere", myWhere);

                xlsResource.setReportParameters(par);

                super.onClick();
            }



        };



        rXlsLnk.add(new AjaxFormSubmitBehavior("onmousedown") {
            private static final long serialVersionUID = 1L;

            @Override
            protected void onSubmit(AjaxRequestTarget target) {
                myWhere = "WHERE
iscr.SISSIONE_COD_SCUOLA='"+MySession.getSessesion().getOperatore().getSissioneScuole().getCodMec()+"'"
+
                " AND iscr.FS_ISCR_AS='"+iscrFilter.getAnnoScolastico()+"'
";

                if(iscrFilter.getPlessoId()!=null &&
!iscrFilter.getPlessoId().equals("-1"))
...
etc etc
....
                   }
                    else
                    {
                      }
                }
            }

            @Override
            protected void onError(AjaxRequestTarget target) {
                myWhere = "WHERE 1=0";
                target.addComponent(feedbackPanel);
            }
        });*

The first time i download the report i obtain an empty report, because empty
parameters. The second time i obtained the report with th first submit
parameter end then and then...

can you help?

thanks a lot

Luca


2009/3/5 Jonas <ba...@gmail.com>

> If it is the browser that caches the report, you can work around this
> by adding something random to the url generated
> by ResourceLink#getUrl, similar to what's done in NonCachingImage.
>
> urlFor(IResourceListener.INTERFACE) + "&wicket:antiCache=" +
> System.currentTimeMillis()
>
> Unfortunatly, ResourceLink#getUrl is final, so you'll probably have to
> create
> your own Link subclass similar to ResourceLink
>
> On Thu, Mar 5, 2009 at 4:33 PM, Luca Provenzani <eu...@gmail.com>
> wrote:
> > in this way it works, but how can i refresh the report when parameter is
> > changed?
> >
> > Until now i change parameter into the onclick of the ResourceLink, but
> now
> > the resource is cached...and then the result report is ever the same..
> >
> > thanks
> > Luca
> >
> > 2009/3/5 Jonas <ba...@gmail.com>
> >
> >> Does it work if you set your Resource setCacheable(true)?
> >>
> >> On Thu, Mar 5, 2009 at 3:21 PM, Luca Provenzani <eu...@gmail.com>
> >> wrote:
> >> > Hi all
> >> >
> >> > This is my situation:
> >> >  i've a ResourceLink based on a JasperReport
> Resource(DynamicWebResource
> >> )
> >> > and all is ok until i use http.
> >> > But if the web server uses https IE can't download the file.
> >> >
> >> > i searched in the web but i 've found only an e-mail with similar
> problem
> >> (
> >> > http://www.nabble.com/Download-Link-Problem-td14693760.html#a14693760
> ),
> >> >  but no answer!
> >> >
> >> > Someone can help?
> >> >
> >> > Regards
> >> >
> >> > Luca
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: ResourceLink, IE and https

Posted by Jonas <ba...@gmail.com>.
If it is the browser that caches the report, you can work around this
by adding something random to the url generated
by ResourceLink#getUrl, similar to what's done in NonCachingImage.

urlFor(IResourceListener.INTERFACE) + "&wicket:antiCache=" +
System.currentTimeMillis()

Unfortunatly, ResourceLink#getUrl is final, so you'll probably have to create
your own Link subclass similar to ResourceLink

On Thu, Mar 5, 2009 at 4:33 PM, Luca Provenzani <eu...@gmail.com> wrote:
> in this way it works, but how can i refresh the report when parameter is
> changed?
>
> Until now i change parameter into the onclick of the ResourceLink, but now
> the resource is cached...and then the result report is ever the same..
>
> thanks
> Luca
>
> 2009/3/5 Jonas <ba...@gmail.com>
>
>> Does it work if you set your Resource setCacheable(true)?
>>
>> On Thu, Mar 5, 2009 at 3:21 PM, Luca Provenzani <eu...@gmail.com>
>> wrote:
>> > Hi all
>> >
>> > This is my situation:
>> >  i've a ResourceLink based on a JasperReport Resource(DynamicWebResource
>> )
>> > and all is ok until i use http.
>> > But if the web server uses https IE can't download the file.
>> >
>> > i searched in the web but i 've found only an e-mail with similar problem
>> (
>> > http://www.nabble.com/Download-Link-Problem-td14693760.html#a14693760),
>> >  but no answer!
>> >
>> > Someone can help?
>> >
>> > Regards
>> >
>> > Luca
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: ResourceLink, IE and https

Posted by Luca Provenzani <eu...@gmail.com>.
in this way it works, but how can i refresh the report when parameter is
changed?

Until now i change parameter into the onclick of the ResourceLink, but now
the resource is cached...and then the result report is ever the same..

thanks
Luca

2009/3/5 Jonas <ba...@gmail.com>

> Does it work if you set your Resource setCacheable(true)?
>
> On Thu, Mar 5, 2009 at 3:21 PM, Luca Provenzani <eu...@gmail.com>
> wrote:
> > Hi all
> >
> > This is my situation:
> >  i've a ResourceLink based on a JasperReport Resource(DynamicWebResource
> )
> > and all is ok until i use http.
> > But if the web server uses https IE can't download the file.
> >
> > i searched in the web but i 've found only an e-mail with similar problem
> (
> > http://www.nabble.com/Download-Link-Problem-td14693760.html#a14693760),
> >  but no answer!
> >
> > Someone can help?
> >
> > Regards
> >
> > Luca
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: ResourceLink, IE and https

Posted by Jonas <ba...@gmail.com>.
Does it work if you set your Resource setCacheable(true)?

On Thu, Mar 5, 2009 at 3:21 PM, Luca Provenzani <eu...@gmail.com> wrote:
> Hi all
>
> This is my situation:
>  i've a ResourceLink based on a JasperReport Resource(DynamicWebResource )
> and all is ok until i use http.
> But if the web server uses https IE can't download the file.
>
> i searched in the web but i 've found only an e-mail with similar problem (
> http://www.nabble.com/Download-Link-Problem-td14693760.html#a14693760),
>  but no answer!
>
> Someone can help?
>
> Regards
>
> Luca
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org