• 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

URL pattern in servlet

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am working on a project has JSF 1.1 and RAD 7 with websphere 6.1. I need a solution for a problem

for E.g:
http://localhost/us/glassy/signOn

in the above url http://localhost/us/glassy is the context path and /signOn is the page which has to be rendered.(I removed .faces using custom filter and custom handler).it is similar for other pages also.

Now in Faces servlet i have to mention the URL pattern. if i give /* the websphere throws an error has not a valid pattern. if i mention /signOn the servlet renders the page correctly.How do i mention a generic URL pattern in the Faces servlet. Any suggestions are appreciated

similar pattern for http://localhost/us/glassy/xyz/home

Thanks
Naresh
 
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
Welcome to the JavaRanch, Naresh!

I'll give my standard warning that user-written Logins are a Bad Thing and that you should be using the J2EE standard container-managed security framework instead. If you do that, you won't have this problem, because the login page won't have a URL at all. Instead, the server will present it when any protected URL is requested and the user isn't already logged in.

Beyond that, the FacesServlet requires an operand as part of the URL, and that operand is parsed out of the URL and used to locate a model View for JSF to render. Therefore, a generic URL, such as "/signOn" doesn't work. It would have to be something like "/signOn.jsf"
 
Naresh Ranganathan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,
Thanks for the reply. From your reply i understand that want signOn to signOn.jsf.yeah internally i ve done that mapping using a filter. Just to access the faces servlet i need a generic pattern. if i give /signOn internally it will convert to signOn.faces in the filter after only it passed through the servlet.

for signOn alone i can specify the pattern /signOn itself.But i also needed a generic URL pattern for the below mentioned URL

http://localhost/us/glassy/xyz/home

here http://localhost/us/glassy is the context path

/xyz/home -i need as servlet path

both xyz and home will change based on the condition.so i need a generic pattern
 
reply
    Bookmark Topic Watch Topic
  • New Topic