• 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

Redirect requests for *.jsp to *.jsf?

 
Greenhorn
Posts: 1
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Long time reader, first time poster (thanks for all the help : )

Is there a way in JSF or, more likely, in JBoss to redirect all requests for a .jsp page to a .jsf request? Can this be done without breaking JSF itself?

Situation :
I have a JSF site running in JBoss that is configured to email me when an exception occurs. However, the most common error seems to be either a confused user or perhaps a bot requesting "/index.jsp" or "/login.jsp" - something with a .jsp extension that is actually a JSF page. If a non-existent page is requested then we 404 and all is well. But, if they request a JSF page that exists such as login.jsp - they'll get a 500 error (handled cleanly) and I'll get an email with the standard : "java.lang.RuntimeException: Cannot find FacesContext" error.

I understand why this exception is being thrown (request to JSF page not going through Faces servlet), but in this case I'd rather catch the request to "login.jsp" somehow and redirect it to "login.jsf" so they get the page they want and I don't get exceptions/error emails. Does that make sense? Basically if someone requests "page.jsp" I want to automatically rewrite the request to "page.jsf"

Environment :
  • JBoss 4.2.2 (I know, it's legacy)
  • JSF 1.2
  • Richfaces 3.3.3 Final


  • To clarify my Faces servlet :


    Let me know if this fits better in the JBoss board... it might.

    Any ideas are welcome.
    Thanks!

     
    If you're gonna buy things, buy this thing and I get a fat kickback:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic