• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF urls and custom filters

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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/>".
reply
    Bookmark Topic Watch Topic
  • New Topic