If the context path is /app then you can mount a page at "/u" with some Indexed UrlCodingStrategy and then the url will look like: /app/u/user1 In that page you can get the parameter value (user1) with pageParameters.get(0). If you want to be '/app/user1' then you'll to to use context path '/', i.e. filter-mapping at /*, and mount that page at '/app'.
If you use Wicket 1.5 then you can create custom IRequestMapper that may do what you want even if the context path is '/app'. On Sat, Mar 5, 2011 at 10:09 PM, devush <[email protected]> wrote: > Hi, > I am able to get the request related information from both Request > and WebRequest. Thanks for that. This i am able to do in the WebPage. > My WebApplication getHomePage is called when ever I call /app or > /app/, so I have to intercept the request before that. > > I am trying with mount(String, Package), but that lead to the specific > URL only. This is in the init() method of WebApplication. > My basic requirement is to serve pages like /app/user1 /app/user2 > /app/user2/profile etc. > > Do i have to create new* methods as described at > https://cwiki.apache.org/WICKET/request-processing-overview.html > > Do I have to implement IRequestCodingStrategy and attach it to Request > Cycle? > thanks > devush > > > > On 05/03/2011, Martin Grigorov <[email protected]> wrote: > > Hi, > > > > On Sat, Mar 5, 2011 at 4:03 PM, devush <[email protected]> wrote: > > > >> Hi, > >> I have following settings in web.xml > >> > >> <servlet-mapping> > >> <servlet-name>myserv</servlet-name> > >> <url-pattern>/app/*</url-pattern> > >> </servlet-mapping> > >> > >> > >> I expect that all requests such as: > >> /app > >> /app/abc > >> /app/xyz > >> > > > > should come to the servlet. But only /app currently works. > >> > >> They actually come but since you don't have mounts at /abc or /xyz > Wicket > > decides there is nothing to do for them. > > /app matches on the App's home page. > > > > > >> Moreover, I want to access the getRequestURL part from the servlet API > >> also, so that i can use the information in the application logic. > >> > >> I am able to do this in the normal servlet and then forward the > >> request to the wicket but in that case the URL at the client remains > >> the same and causes problems later in the application. > >> > >> See if Wicket's Request#getPath() (Wicket 1.4.x) or #getUrl() (Wicket > > 1.5.x) returns what you need. > > Otherwise you can always use the underlying HttpServletRequest: > > - 1.4.x - WebRequest#getHttpServletRequest() > > - 1.5.x - (HttpServletRequest) Request#getContainerRequest() > > > >> > >> thanks > >> devush > >> > >> --------------------------------------------------------------------- > >> 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] > >
