You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Douglas Ferguson <th...@gmail.com> on 2012/03/02 09:21:07 UTC

More wicket 1.5 questions

In 1.4 I did the following, what are the alternatives in 1.5?

1) AbstractRequestTargetUrlCodingStrategy to mount a path to 301 redirect
2) Overrode newRequestCycleProcessor so that I can set the no cache headers.

	private void setNoCacheHeader(RequestCycle requestCycle) {
		final WebResponse response = ((WebRequestCycle) requestCycle).getWebResponse();
		// so firefox won't keep a cached version of the page which breaks the back button
		response.getHttpServletResponse().setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store");
	}




Re: More wicket 1.5 questions

Posted by Martin Grigorov <mg...@apache.org>.
On Fri, Mar 2, 2012 at 10:29 AM, Douglas Ferguson <th...@gmail.com> wrote:
>
> On Mar 2, 2012, at 2:26 AM, Martin Grigorov wrote:
>
>> On Fri, Mar 2, 2012 at 10:21 AM, Douglas Ferguson <th...@gmail.com> wrote:
>>> In 1.4 I did the following, what are the alternatives in 1.5?
>>>
>>> 1) AbstractRequestTargetUrlCodingStrategy to mount a path to 301 redirect
>>
>> I don't understand you
>
> Does this work?
>
>                mount(new MountMapper(path, new RedirectRequestHandler(destination, 301)));

It should. Just try it.

>
>
>>
>>> 2) Overrode newRequestCycleProcessor so that I can set the no cache headers.
>>
>> https://cwiki.apache.org/WICKET/caching-in-wicket-15.html
>>
>>>
>>>        private void setNoCacheHeader(RequestCycle requestCycle) {
>>>                final WebResponse response = ((WebRequestCycle) requestCycle).getWebResponse();
>>>                // so firefox won't keep a cached version of the page which breaks the back button
>>>                response.getHttpServletResponse().setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store");
>>>        }
>>>
>>>
>>>
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com
>>
>> ---------------------------------------------------------------------
>> 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
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: More wicket 1.5 questions

Posted by Douglas Ferguson <th...@gmail.com>.
On Mar 2, 2012, at 2:26 AM, Martin Grigorov wrote:

> On Fri, Mar 2, 2012 at 10:21 AM, Douglas Ferguson <th...@gmail.com> wrote:
>> In 1.4 I did the following, what are the alternatives in 1.5?
>> 
>> 1) AbstractRequestTargetUrlCodingStrategy to mount a path to 301 redirect
> 
> I don't understand you

Does this work?

		mount(new MountMapper(path, new RedirectRequestHandler(destination, 301)));


> 
>> 2) Overrode newRequestCycleProcessor so that I can set the no cache headers.
> 
> https://cwiki.apache.org/WICKET/caching-in-wicket-15.html
> 
>> 
>>        private void setNoCacheHeader(RequestCycle requestCycle) {
>>                final WebResponse response = ((WebRequestCycle) requestCycle).getWebResponse();
>>                // so firefox won't keep a cached version of the page which breaks the back button
>>                response.getHttpServletResponse().setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store");
>>        }
>> 
>> 
>> 
> 
> 
> 
> -- 
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
> 
> ---------------------------------------------------------------------
> 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: More wicket 1.5 questions

Posted by Douglas Ferguson <th...@gmail.com>.
I want to save off the previous page at then end of each request. 
Can be handy for things like oauth (making sure we return to the correct spot in the app).

This is the only thing I could come up with.

				public void onEndRequest(RequestCycle cycle)
				{
					if(cycle.getActiveRequestHandler() instanceof IPageClassRequestHandler){
						VHConnectSession.get().setPreviousPage((IPageClassRequestHandler)cycle.getActiveRequestHandler());
					}else{
						log.error("cycle is not an IpageClassRequesthandler "+cycle);
					}
				}



On Mar 2, 2012, at 2:26 AM, Martin Grigorov wrote:

> On Fri, Mar 2, 2012 at 10:21 AM, Douglas Ferguson <th...@gmail.com> wrote:
>> In 1.4 I did the following, what are the alternatives in 1.5?
>> 
>> 1) AbstractRequestTargetUrlCodingStrategy to mount a path to 301 redirect
> 
> I don't understand you
> 
>> 2) Overrode newRequestCycleProcessor so that I can set the no cache headers.
> 
> https://cwiki.apache.org/WICKET/caching-in-wicket-15.html
> 
>> 
>>        private void setNoCacheHeader(RequestCycle requestCycle) {
>>                final WebResponse response = ((WebRequestCycle) requestCycle).getWebResponse();
>>                // so firefox won't keep a cached version of the page which breaks the back button
>>                response.getHttpServletResponse().setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store");
>>        }
>> 
>> 
>> 
> 
> 
> 
> -- 
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
> 
> ---------------------------------------------------------------------
> 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: More wicket 1.5 questions

Posted by Martin Grigorov <mg...@apache.org>.
On Fri, Mar 2, 2012 at 10:21 AM, Douglas Ferguson <th...@gmail.com> wrote:
> In 1.4 I did the following, what are the alternatives in 1.5?
>
> 1) AbstractRequestTargetUrlCodingStrategy to mount a path to 301 redirect

I don't understand you

> 2) Overrode newRequestCycleProcessor so that I can set the no cache headers.

https://cwiki.apache.org/WICKET/caching-in-wicket-15.html

>
>        private void setNoCacheHeader(RequestCycle requestCycle) {
>                final WebResponse response = ((WebRequestCycle) requestCycle).getWebResponse();
>                // so firefox won't keep a cached version of the page which breaks the back button
>                response.getHttpServletResponse().setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store");
>        }
>
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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