File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF urls and custom filters

 
Gina vernon
Ranch Hand
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 17622
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/>".
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic