tag:blogger.com,1999:blog-7217870573379117597.post3838161214220955174..comments2024-03-18T06:52:55.517+02:00Comments on Improve your life Through Science and Art: JSF: The JavaServer Faces TechnologyMohamed Tamanhttp://www.blogger.com/profile/14806768946804079737noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7217870573379117597.post-84627495435799004292012-08-23T11:56:17.643+02:002012-08-23T11:56:17.643+02:00Thanks for your replay,
I already cast it, but i ...Thanks for your replay,<br /><br />I already cast it, but i need the forward page not the current url <br /><br />I'm using JSF framework and when you return the name of page without "?faces-redirect=true" from method like "main" for example the content of page will changed but the url will be the same like index.xhtml for example, so when getServletPath i will get /Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7217870573379117597.post-10894590273326411742012-08-23T11:31:55.243+02:002012-08-23T11:31:55.243+02:00In Servlet filter, the server pass the generic Ser...In Servlet filter, the server pass the generic ServletRequest, you should cast it to HttpServeletrequest first to get the http properties, then you can get all the URIs paths required for example:<br /><br /> public void doFilter(ServletRequest request, ServletResponse response,<br /> FilterChain chain) throws IOException,<br />Mohamed Tamanhttps://www.blogger.com/profile/14806768946804079737noreply@blogger.comtag:blogger.com,1999:blog-7217870573379117597.post-78721106623057729852012-08-22T17:18:33.038+02:002012-08-22T17:18:33.038+02:00Hi mohamed,
WoooW very good explanation topic :)
...Hi mohamed,<br />WoooW very good explanation topic :)<br /><br />actually i need to know how to get servletPath of the forward page in filter class <br />i tried request.getAttribute("javax.servlet.forward.request_uri") and i get null, i tried to get it from externalContext.getRequestMap().get(RequestDispatcher.FORWARD_REQUEST_URI) and of course i got nullPointer because it's not a Anonymousnoreply@blogger.com