You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Benny Weingarten <be...@myworklight.com> on 2008/09/11 18:31:34 UTC

Wciket fails to set seesion and request attributes for external webpages

Hello.

I am worker on a Jboss server, with a <security-constraint> set on the same
path as the wicket filter. Thus, all wicket pages are under the security
constraint. 

To support that I have a login page outside the path of
<security-constraint>. I also have an error page in teh same location as the
login page:

Path:
/ login.jsp
/ error.jsp
/folder_under_constraint/Wicket_Class1.java
/folder_under_constraint/Wicket_Class2.java
.
.
/folder_under_constraint/Wicket_Classn.java

In case of an error I want to redirect to invalidate the session, redirect
to the error page, and pass an error message to the error page. I haven't
been able to do this. It appears that wicket doesn't pass session or request
attributes to external pages. What am I doing wrong?

Session.get().invalidate();
// none of the following setAttribute statements actually mange to pass any
http attributes to the error page.
httpServletRequest.setAttribute("some_attribute", "some_value");
HttpServletRequest.getSession().setAttribute("some_attribute",
"some_value");
request.getParameterMap().put("some_attribute", "some_value");
throw new
org.apache.wicket.RedirectToUrlException("/some_page_not_under_wicket_filter.jsp");

thanks,
Benny.

-- 
View this message in context: http://www.nabble.com/Wciket-fails-to-set-seesion-and-request-attributes-for-external-webpages-tp19438970p19438970.html
Sent from the Wicket - User 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 fails to set seesion and request attributes for external webpages

Posted by Benny Weingarten <be...@myworklight.com>.
Thanks Igor.

I did not try your solution, but instead I decided to make the "External"
page a wicket page inside my application.

Benny.



igor.vaynberg wrote:
> 
> it is quiet obvious that if you issue a redirect then a new request is
> created from the client to the server, and thus new request/response
> objects - so instead of setting your paramters into the request object
> you have to encode them into the url that you give to the redirect
> exception.
> 
> -igor
> 
> On Sat, Sep 13, 2008 at 11:09 PM, Benny Weingarten
> <be...@myworklight.com> wrote:
>>
>> No response.. I'll try re-posting this:
>>
>> Basically I want a wicket page to forward the user to a non-wicket page
>> and
>> pass some request attributes to that non-wicket page.
>>
>> I have not been successful in doing so. See the code I use below.
>>
>> Any help would be appreciated.
>> thanks,
>> Benny.
>>
>>
>>
>>
>> Benny Weingarten wrote:
>>>
>>> Hello.
>>>
>>> I am working on a Jboss server, with a <security-constraint> set on the
>>> same path as the wicket filter. Thus, all wicket pages are under the
>>> security constraint.
>>>
>>> To support that I have a login page outside the path of
>>> <security-constraint>. I also have an error page in the same location as
>>> the login page:
>>>
>>> Path:
>>> / login.jsp
>>> / error.jsp
>>> /folder_under_constraint/Wicket_Class1.java
>>> /folder_under_constraint/Wicket_Class2.java
>>> .
>>> .
>>> /folder_under_constraint/Wicket_Classn.java
>>>
>>> In case of an error I want to redirect to invalidate the session,
>>> redirect
>>> to the error page, and pass an error message to the error page. I
>>> haven't
>>> been able to do this. It appears that wicket doesn't pass session or
>>> request attributes to external pages. What am I doing wrong?
>>>
>>> Session.get().invalidate();
>>> // none of the following setAttribute statements actually mange to pass
>>> any http attributes to the error page.
>>> httpServletRequest.setAttribute("some_attribute", "some_value");
>>> HttpServletRequest.getSession().setAttribute("some_attribute",
>>> "some_value");
>>> request.getParameterMap().put("some_attribute", "some_value");
>>> throw new
>>> org.apache.wicket.RedirectToUrlException("/some_page_not_under_wicket_filter.jsp");
>>>
>>> thanks,
>>> Benny.
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Wciket-fails-to-set-seesion-and-request-attributes-for-external-webpages-tp19438970p19477610.html
>> Sent from the Wicket - User 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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Wciket-fails-to-set-seesion-and-request-attributes-for-external-webpages-tp19438970p19513081.html
Sent from the Wicket - User 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 fails to set seesion and request attributes for external webpages

Posted by Igor Vaynberg <ig...@gmail.com>.
it is quiet obvious that if you issue a redirect then a new request is
created from the client to the server, and thus new request/response
objects - so instead of setting your paramters into the request object
you have to encode them into the url that you give to the redirect
exception.

-igor

On Sat, Sep 13, 2008 at 11:09 PM, Benny Weingarten
<be...@myworklight.com> wrote:
>
> No response.. I'll try re-posting this:
>
> Basically I want a wicket page to forward the user to a non-wicket page and
> pass some request attributes to that non-wicket page.
>
> I have not been successful in doing so. See the code I use below.
>
> Any help would be appreciated.
> thanks,
> Benny.
>
>
>
>
> Benny Weingarten wrote:
>>
>> Hello.
>>
>> I am working on a Jboss server, with a <security-constraint> set on the
>> same path as the wicket filter. Thus, all wicket pages are under the
>> security constraint.
>>
>> To support that I have a login page outside the path of
>> <security-constraint>. I also have an error page in the same location as
>> the login page:
>>
>> Path:
>> / login.jsp
>> / error.jsp
>> /folder_under_constraint/Wicket_Class1.java
>> /folder_under_constraint/Wicket_Class2.java
>> .
>> .
>> /folder_under_constraint/Wicket_Classn.java
>>
>> In case of an error I want to redirect to invalidate the session, redirect
>> to the error page, and pass an error message to the error page. I haven't
>> been able to do this. It appears that wicket doesn't pass session or
>> request attributes to external pages. What am I doing wrong?
>>
>> Session.get().invalidate();
>> // none of the following setAttribute statements actually mange to pass
>> any http attributes to the error page.
>> httpServletRequest.setAttribute("some_attribute", "some_value");
>> HttpServletRequest.getSession().setAttribute("some_attribute",
>> "some_value");
>> request.getParameterMap().put("some_attribute", "some_value");
>> throw new
>> org.apache.wicket.RedirectToUrlException("/some_page_not_under_wicket_filter.jsp");
>>
>> thanks,
>> Benny.
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Wciket-fails-to-set-seesion-and-request-attributes-for-external-webpages-tp19438970p19477610.html
> Sent from the Wicket - User 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
>
>

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


Re: Wicket fails to set seesion and request attributes for external webpages

Posted by Benny Weingarten <be...@myworklight.com>.
No response.. I'll try re-posting this:

Basically I want a wicket page to forward the user to a non-wicket page and
pass some request attributes to that non-wicket page. 

I have not been successful in doing so. See the code I use below.

Any help would be appreciated.
thanks,
Benny.




Benny Weingarten wrote:
> 
> Hello.
> 
> I am working on a Jboss server, with a <security-constraint> set on the
> same path as the wicket filter. Thus, all wicket pages are under the
> security constraint. 
> 
> To support that I have a login page outside the path of
> <security-constraint>. I also have an error page in the same location as
> the login page:
> 
> Path:
> / login.jsp
> / error.jsp
> /folder_under_constraint/Wicket_Class1.java
> /folder_under_constraint/Wicket_Class2.java
> .
> .
> /folder_under_constraint/Wicket_Classn.java
> 
> In case of an error I want to redirect to invalidate the session, redirect
> to the error page, and pass an error message to the error page. I haven't
> been able to do this. It appears that wicket doesn't pass session or
> request attributes to external pages. What am I doing wrong?
> 
> Session.get().invalidate();
> // none of the following setAttribute statements actually mange to pass
> any http attributes to the error page.
> httpServletRequest.setAttribute("some_attribute", "some_value");
> HttpServletRequest.getSession().setAttribute("some_attribute",
> "some_value");
> request.getParameterMap().put("some_attribute", "some_value");
> throw new
> org.apache.wicket.RedirectToUrlException("/some_page_not_under_wicket_filter.jsp");
> 
> thanks,
> Benny.
> 
> 

-- 
View this message in context: http://www.nabble.com/Wciket-fails-to-set-seesion-and-request-attributes-for-external-webpages-tp19438970p19477610.html
Sent from the Wicket - User 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