You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by yferahi <yf...@yahoo.com> on 2010/10/01 15:59:27 UTC

Wicket and HttpServletRequestWrapper

Hi,

I am trying to implement Wicket1.4.10 + Wicket-Auth-role + Spring Security +
SSO (SiteMinder)..
I am mocking siteMinder by using a Filter that is invoked first after each
request, this filter wraps the original HttpServletRequest by my
MockRequest. MockRequest adds 2 headers SM_USER and SM_ROLE.
In a debug mode, I can see the MockRequest passed through 2 Spring Security
filters (SecurityContextPersistenceFilter and
preauth.RequestHeaderAuthenticationFilter)..and all the request headers set:
Get which points to my next page and 2 SiteMinder headers.

However, the third filter in the chain, WicketFilter, creates a new request
and I loose my Get next page and my 2 siteMinder headers

WicketFilter
doFilter(){
...
        if (lastModified == -1){
		boolean requestHandledByWicket = doGet(httpServletRequest,
httpServletResponse);
		if (requestHandledByWicket == false){
			chain.doFilter(request, response);
		}
        }
}

doGet(){
..
           // Create a new webrequest to wrap the request
	final WebRequest request = webApplication.newWebRequest(servletRequest);
}


Any request will bring me to the home page

Thanks

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-and-HttpServletRequestWrapper-tp2910960p2910960.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Wicket and HttpServletRequestWrapper

Posted by yferahi <yf...@yahoo.com>.
I made a post then deleted it, and reposted with different update

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Re-Wicket-and-HttpServletRequestWrapper-tp2917025p2954276.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Wicket and HttpServletRequestWrapper

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I don't understand what is the relation to your original question and the
one in the linked mail thread.

Cite:
In requestParameters object I can see the para: queryString set to my
requested page: wicket:bookmarkablePage=:wicket.story9.page.Home
The resole method always ends up at target =
resolveHomePageTarget(requestCycle, requestParameters);

A partial dump of request object:
GET /1WicketExample/?wicket:bookmarkablePage=:web.wicket.story9.page.Home
HTTP/1.1
Once there is ":web" in front of the parameter value and the other time
there is not. Did you make any manual changes before posting ?


On Mon, Oct 4, 2010 at 2:43 PM, yferahi <yf...@yahoo.com> wrote:

>
> Hi Martin,
>
> In regards to my post:
>
> http://apache-wicket.1842946.n4.nabble.com/Wicket-and-HttpServletRequestWrapper-tc2930919.html#a2930919
>
> It seems that the HttpServletRequest is always preserved as a member,
> however
> WebRequestCycleProcessor{
>        resolve{
>                ...
>                // See whether this request points to a bookmarkable page
>                if (requestParameters.getBookmarkablePageClass() != null) {
>                        target = resolveBookmarkablePage(requestCycle,
> requestParameters);
>                }
> }
> Always return null and resolve falls back on the HomePage.
>
> Thanks
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Re-Wicket-and-HttpServletRequestWrapper-tp2917025p2954232.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket and HttpServletRequestWrapper

Posted by yferahi <yf...@yahoo.com>.
Hi Martin,

In regards to my post:
http://apache-wicket.1842946.n4.nabble.com/Wicket-and-HttpServletRequestWrapper-tc2930919.html#a2930919

It seems that the HttpServletRequest is always preserved as a member,
however  
WebRequestCycleProcessor{ 
        resolve{ 
                ... 
                // See whether this request points to a bookmarkable page 
                if (requestParameters.getBookmarkablePageClass() != null) { 
                        target = resolveBookmarkablePage(requestCycle,
requestParameters); 
                } 
}
Always return null and resolve falls back on the HomePage.

Thanks

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Re-Wicket-and-HttpServletRequestWrapper-tp2917025p2954232.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Wicket and HttpServletRequestWrapper

Posted by Martin Grigorov <mg...@apache.org>.
On Fri, Oct 1, 2010 at 3:59 PM, yferahi <yf...@yahoo.com> wrote:

>
> Hi,
>
> I am trying to implement Wicket1.4.10 + Wicket-Auth-role + Spring Security
> +
> SSO (SiteMinder)..
> I am mocking siteMinder by using a Filter that is invoked first after each
> request, this filter wraps the original HttpServletRequest by my
> MockRequest. MockRequest adds 2 headers SM_USER and SM_ROLE.
> In a debug mode, I can see the MockRequest passed through 2 Spring Security
> filters (SecurityContextPersistenceFilter and
> preauth.RequestHeaderAuthenticationFilter)..and all the request headers
> set:
> Get which points to my next page and 2 SiteMinder headers.
>
> However, the third filter in the chain, WicketFilter, creates a new request
> and I loose my Get next page and my 2 siteMinder headers
>
> WicketFilter
> doFilter(){
> ...
>        if (lastModified == -1){
>                boolean requestHandledByWicket = doGet(httpServletRequest,
> httpServletResponse);
>                if (requestHandledByWicket == false){
>                        chain.doFilter(request, response);
>                }
>        }
> }
>
> doGet(){
> ..
>           // Create a new webrequest to wrap the request
>        final WebRequest request =
> webApplication.newWebRequest(servletRequest);
>
This creates Wicket's org.apache.wicket.protocol.http.WebRequest (actually
ServletWebRequest) and the original HttpServletRequest is preserved as a
member.
Use #getHttpServletRequest() to get it.

> }
>
>
> Any request will bring me to the home page
>
> Thanks
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-and-HttpServletRequestWrapper-tp2910960p2910960.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>