BTW, if you get a NPE on RequestCycle.get() then you most likely place this code outside a Wicket Component like a Page.
Try moving it to a page first and see if you grab a reference to the request object. If you do, then pass it as a parameter to your other method/class. For older version of Wicket < 1.5.x see: https://cwiki.apache.org/WICKET/request-cycle-and-request-cycle-processor.ht ml For newer version see: https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html ~ Thank you, Paul Bors -----Original Message----- From: Paul Bors [mailto:[email protected]] Sent: Monday, August 13, 2012 1:18 PM To: [email protected] Subject: RE: how to get HttpServletRequest in My Application class For your reference also see: https://cwiki.apache.org/WICKET/getting-a-url-for-display.html ~ Thank you, Paul Bors -----Original Message----- From: wicket user [mailto:[email protected]] Sent: Monday, August 13, 2012 1:07 PM To: [email protected] Subject: Re: how to get HttpServletRequest in My Application class I am getting java.lang.NullPointerException ((ServletWebRequest)RequestCycle.get().getRequest()).getContainerRequest() . -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/how-to-get-HttpServletRequest-in- My-Application-class-tp4651189p4651196.html Sent from the Users forum mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
