| Author |
JSF urls and custom filters
|
Gina vernon
Ranch Hand
Joined: Jan 16, 2009
Posts: 108
|
|
If anyone has a solution to this problem, please provide some input.
I am using rich faces and JSF navigation in my application. I created a custom filter to protect resources that need authentication.
The dir structure is such:
_ _App Contx
|
|_ _css
|
|_ _protected pages
|
|
Welcome.page
The link ref tags in the welcome page and protected pages ofcourse point to the CSS using diff paths. However, when jsf navigates from welcome to a protected page the browser still shows welcome.page with sessionid appended and not the url of the protected page. So, I have to map the filter for all requests(*). I would like to able to map the filter only to requests that only contain 'protected'.
This also means the browser has no idea whats going on and when the server navigates to the protected page, the browser seems to still be pointing to the welcome page css path, thus no css is rendered in the protected page.
|
 |
Scott Robertson
Greenhorn
Joined: Nov 29, 2010
Posts: 2
|
|
In your faces-config.xml you should be able to add the empty <redirect/> tag for the navigation case e.g.:
This will make sure the URL is of the page being directed to.
See here for more info:
http://www.winstonprakash.com/articles/jsf/jsf_url_dispatch.htm
|
 |
Gina vernon
Ranch Hand
Joined: Jan 16, 2009
Posts: 108
|
|
|
Scott, thanks for the reply. Adding the redirect tag to xml file causes a validation error as it has not start tag.
|
 |
Gina vernon
Ranch Hand
Joined: Jan 16, 2009
Posts: 108
|
|
Gina vernon wrote:Scott, thanks for the reply. Adding the redirect tag to xml file causes a validation error as it has not start tag.
nevemind. I fixed it. I tink the slash should be at the end of the redirect tag. Thanks.
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14456
|
|
Gina vernon wrote:
Gina vernon wrote:Scott, thanks for the reply. Adding the redirect tag to xml file causes a validation error as it has not start tag.
nevemind. I fixed it. I tink the slash should be at the end of the redirect tag. Thanks.
Yep. It's "<redirect/>".
|
 |
 |
|
|
subject: JSF urls and custom filters
|
|
|