This content has been marked as final.
Show 6 replies
-
1. Re: retrieve the URL from request and forward to according p
jyc5131 Apr 10, 2007 4:58 AM (in response to jyc5131)any better solution or resolve the exception will be appreciated.
online to wait for your help!!! -
2. Re: retrieve the URL from request and forward to according p
jyc5131 Apr 10, 2007 5:24 AM (in response to jyc5131)String path = request.getPathInfo(); if(path.equals("/")){ response.sendError(HttpServletResponse.SC_FORBIDDEN); return; } String[] p = path.split("/"); String uName = null; UserMgr uMgr = (UserMgr)Component.getInstance("userMgr",SESSION); User u; if(p.length == 2){ uName = p[1]; u= userMgr.findByUserName(uName); }else{ response.sendError(HttpServletResponse.SC_FORBIDDEN); } if(u != null) RequestDispatcher rd; rd = request.getRequestDispatcher("/user/showSetting.do?userID=" + user.getId() ); rd.forward(request,response); return; }else { response.sendError(HttpServletResponse.SC_FORBIDDEN); return; }
-
3. Re: retrieve the URL from request and forward to according p
pmuir Apr 10, 2007 5:47 AM (in response to jyc5131)A couple of options: (1) the urlrewrite filter (see the wiki example in CVS) or (2) a page action (see lots of forum posts).
-
4. Re: retrieve the URL from request and forward to according p
jyc5131 Apr 10, 2007 10:25 PM (in response to jyc5131)for the page action, then the URL must be with seam suffix, otherwise it won't be trigged.
for example, i want to fire action when the url is http://xxx/username/jyc5131
but it is impossible. you must have such url http://xxx/username/jyc5131.seam.
right?
more help is appreciated!
more how can i get the URL in Seam context?
Thanks -
5. Re: retrieve the URL from request and forward to according p
christian.bauer Apr 11, 2007 1:31 AM (in response to jyc5131)Just use URLRewriteFilter, outside of Seam in your web.xml. Search it with Google.
-
6. Re: retrieve the URL from request and forward to according p
jyc5131 Apr 11, 2007 9:29 AM (in response to jyc5131)thank you petemuir christian.bauer , URLwriter is wonderful solution