This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Extension Mapping Not Working

 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cannot get a simple JSF app to work. Specifically, if I include the following in the web.xml file:



And then i have the following directory structure:

webapps/simplejsf/test.jsp

When I type in the URL http://someserver.com/simplejsf/test.jsf the page is not rendered. I get a page that says

"Not Found

The requested URL /simplejsf/test.jsf was not found on this server."

However I can go directly to http://someserver.com/simplejsf/test.jsp and the file is displayed.

Are there any glaring issues here? I have tried using "/faces/*" and that doesn't seem to work either. I can't tell if the servlet FacesServlet is being entered at all...and since I don't have it's source code I can't really debug it...
 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Update:

I found out that when i change the url-pattern in web.xml to:



When I type in the URL http://someserver.com/simplejsf/faces/test.jsp the page IS rendered.

Why would this url-pattern work when the extension mapping does not? Are there any issues with Sun's Implementation (1_1_01) that don't allow extension mapping?
 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After much research, I have found out that the problem had nothing to do with JSF. Requests were being routed through Apache and Apache was blocking anything that wasn't either a servlet or JSP, so requests to *.jsf were being blocked at the Apache level.

I guess I should have figured this out when the access logs weren't showing 404 errors in tomcat. But then again, neither were requests to http://someserver/com/doesnotexist.htm so I figured this was some kind of setting with the logging....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic