my dog learned polymorphism*
The moose likes JSF and the fly likes server not mapping JSF url-pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "server not mapping JSF url-pattern" Watch "server not mapping JSF url-pattern" New topic
Author

server not mapping JSF url-pattern

seb petterson
Ranch Hand

Joined: Mar 04, 2005
Posts: 118
In my web.xml file I have:
as well asBut still when I type in a url for a jsp file with the extension replaced for jsf the webserver returns "file not found".
I should mention that I have a boiled down version of my webapp working on a local tomcat instance. However, the target environment for the jsf enabled jsps is an existing webapplication in a WebSphere Application Server, and here it fails.

In the web.xml file there are also many elements declaring various filter-mappings and servlet-mappings, including for the url-pattern /*, can this be the cause of the mapping not working for *.jsf?

Thanks in advance,

Seb
[ July 27, 2005: Message edited by: seb petterson ]
Paul Smiley
Ranch Hand

Joined: Jun 02, 2000
Posts: 244
Try to use an index.html file with content like this

<html>
<head>
<meta http-equiv="Refresh" content= "0; URL=pages/home.jsf"/>
<title>Start Web Application</title>
</head>
<body>


</body>
</html>

This will start the FacesContext for you.

And yes, the mapping to * may be a gotcha. Which one is first in the file?
[ July 27, 2005: Message edited by: Paul Smiley ]
seb petterson
Ranch Hand

Joined: Mar 04, 2005
Posts: 118
Originally posted by Paul Smiley:
Try to use an index.html file with content like this

<html>
<head>
<meta http-equiv="Refresh" content= "0; URL=pages/home.jsf"/>
<title>Start Web Application</title>
</head>
<body>


</body>
</html>

This will start the FacesContext for you.

And yes, the mapping to * may be a gotcha. Which one is first in the file?

[ July 27, 2005: Message edited by: Paul Smiley ]


Thanks but it's still the same. Which is consistent with my assumption that the container doesnt at all map the url to the FacesServlet, it redirects but then returns "file not found".

As to your question: the /* filter-mapping is before the *.jsf mapping.

/seb
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Originally posted by seb petterson:

As to your question: the /* filter-mapping is before the *.jsf mapping.

Extension mapping is only considered when there is no path mapping. In other words, /* will always take precedence over *.jsf!


A good workman is known by his tools.
seb petterson
Ranch Hand

Joined: Mar 04, 2005
Posts: 118
Originally posted by Marc Peabody:

Extension mapping is only considered when there is no path mapping. In other words, /* will always take precedence over *.jsf!


Well, you can intercept all request with a filter mapped with /* and then pass on the request to a servlet or to the next filter in the FilterChain. Ofcourse if the filter doesnt pass on the request there is a problem. My problem is that I don't have the source code for the filter that intercepts all url-patterns, so I dont know if it doesnt pass on the request and in that case how it processes it.

/seb
[ July 27, 2005: Message edited by: seb petterson ]
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Originally posted by seb petterson:


Well, you can intercept all request with a filter mapped with /* and then pass on the request to a servlet or to the next filter in the FilterChain. Ofcourse if the filter doesnt pass on the request there is a problem. My problem is that I don't have the source code for the filter that intercepts all url-patterns, so I dont know if it doesnt pass on the request and in that case how it processes it.

/seb

[ July 27, 2005: Message edited by: seb petterson ]


Sorry. You're right. Your comment that one came before the other made me overlook that the first was a filter (which negates the difference of what order it comes in relation to a servlet mapping.

I think I would write another /* filter to allow you to inspect the request after the problematic filter is done with it. It could show you if the request path is getting unexpectedly changed.
seb petterson
Ranch Hand

Joined: Mar 04, 2005
Posts: 118
Ok I think I got it.

The problem was not JSF related at all: I didn't know that WebSphere had it's own way of updating the deployment descriptor, so just editing the web.xml file in the application directory wasn't enough. So all the changes I had done with the mappings had not gone through at all. (FYI: websphere admin console has a an option called "Use Metadata From Binaries" and if you check it, it updates the master configuration according to your changes and after this + a restart of the application, the application will finally be updated accordingly.)
Maneessh saxena
Ranch Hand

Joined: Oct 03, 2006
Posts: 125
seb petterson wrote:In my web.xml file I have:
as well asBut still when I type in a url for a jsp file with the extension replaced for jsf the webserver returns "file not found".
I should mention that I have a boiled down version of my webapp working on a local tomcat instance. However, the target environment for the jsf enabled jsps is an existing webapplication in a WebSphere Application Server, and here it fails.

In the web.xml file there are also many elements declaring various filter-mappings and servlet-mappings, including for the url-pattern /*, can this be the cause of the mapping not working for *.jsf?

Thanks in advance,

Seb
[ July 27, 2005: Message edited by: seb petterson ]


Hi Ranchers,

I am facing the similar problem. Actually I need to configure a JSF application on eclipse Ide using Websphere CE server. This application currently working on Netbeans Ide and uses Sun One Server. I tried to configure on eclipse using Tomcat first and have tried to run a jsp. I got "404 page not found error" as mentioned in quoted message and the extension changed to jsf. I am new to Websphere and have no idea, how to go about. Could you please let me know the steps involved or probably the helpful links to get my work done.

Thanks & Regards


SCJP 1.4, SCWCD 1.5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: server not mapping JSF url-pattern
 
Similar Threads
How do I start a web application on an xhtml page?
WebSphere not mapping url-pattern: *.jsf
Extension Mapping Not Working
Servlet mapping
JSF Components does not appear on the browser