You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Michael O'Cleirigh <mi...@rivulet.ca> on 2011/02/05 16:50:31 UTC

How to get access to HttpServletRequest in wicket 1.5-SNAPSHOT?

Hello,

I'm trying to fix a bug in wicketstuff/core master branch that tracks 
wicket 1.5-SNAPSHOT. In the 
/jdk-1.6-parent/javaee-inject/src/main/java/org/wicketstuff/javaee/injection/JavaEEProxyFieldValueFactory.java 
it needs to get access to the underlying HttpSession.

In 1.5-RC1 this worked (line 105 in the file):

HttpSession session = ((ServletWebRequest) 
RequestCycle.get().getRequest()).getHttpServletRequest().getSession();

But in 1.5-SNAPSHOT ServletWebRequest doesn't have a 
getHttpServletReqest() method anymore.

See the build error here: 
http://wicketstuff.org/hudson/job/Wicket%20Stuff%20Core%20Java5%20%28wicket%201.5-SNAPSHOT%29/81/org.wicketstuff$wicket-shiro/console

What is the new way to get access to the HttpServletRequest?

Thanks,

Mike







Re: How to get access to HttpServletRequest in wicket 1.5-SNAPSHOT?

Posted by Michael O'Cleirigh <mi...@rivulet.ca>.
I found the answer in this recent commit: 
https://github.com/mocleiri/wicket/commit/f973ddb47700857b8af2d1bc2075bbf1f03e5209 
(scroll down to the first file: Include.java).

HttpSession session = ((ServletWebRequest) 
RequestCycle.get().getRequest()).getHttpServletRequest().getSession();

becomes:
HttpSession session = ((HttpServletRequest) 
RequestCycle.get().getRequest()).getContainerRequest().getSession();

Mike


>
> I'm trying to fix a bug in wicketstuff/core master branch that tracks 
> wicket 1.5-SNAPSHOT. In the 
> /jdk-1.6-parent/javaee-inject/src/main/java/org/wicketstuff/javaee/injection/JavaEEProxyFieldValueFactory.java 
> it needs to get access to the underlying HttpSession.
>
> In 1.5-RC1 this worked (line 105 in the file):
>
> HttpSession session = ((ServletWebRequest) 
> RequestCycle.get().getRequest()).getHttpServletRequest().getSession();
>
> But in 1.5-SNAPSHOT ServletWebRequest doesn't have a 
> getHttpServletReqest() method anymore.
>
> See the build error here: 
> http://wicketstuff.org/hudson/job/Wicket%20Stuff%20Core%20Java5%20%28wicket%201.5-SNAPSHOT%29/81/org.wicketstuff$wicket-shiro/console
>
> What is the new way to get access to the HttpServletRequest?
>
> Thanks,
>
> Mike
>
>
>
>
>
>