aspose file tools
The moose likes JSF and the fly likes navigation to servlets in JSF 2.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "navigation to servlets in JSF 2.0" Watch "navigation to servlets in JSF 2.0" New topic
Author

navigation to servlets in JSF 2.0

Mark Bryles
Greenhorn

Joined: Aug 30, 2006
Posts: 2
Hi guys,

I am attempting to migrate a JSF 1.2 and Woodstock project to JSF 2.0 (and ExtJs). When I replace the jsf-api and jsf-impl jars, update the web.xml and faces-config.xml files, navigation to a servlet (rather than a page) no longer works: I get a 404 response, servlet not found.

Here, for example, is what used to work:

In the web.xml file:

...
<servlet>
<servlet-name>LoginServlet</servlet-name>
<servlet-class>com.mycompany.servlets.LoginServlet</servlet-class>
</servlet>
...
<servlet-mapping>
<servlet-name>LoginServlet</servlet-name>
<url-pattern>/LoginServlet</url-pattern>
</servlet-mapping>
...

And in the faces-config.xml:

...
<navigation-rule>
<from-view-id>/Login.jsp</from-view-id>
<navigation-case>
<from-outcome>case_login</from-outcome>
<to-view-id>/LoginServlet</to-view-id>
</navigation-case>
</navigation-rule>
...

Navigating to pages defined in navigation rules works fine; so that proves that the action methods are properly feeding strings to the NavigationHandler and that the later is working.

Does anyone have any suggestions as to what the problem might be? I want to migrate the application piece by piece from the older technology it is currently using to Mojarra and a snazzy JavaScript library.

The application is running on Tomcat 6.0 and JDK 6.0.

Thanks much in advance.
Ed Burns
author
Ranch Hand

Joined: Sep 11, 2006
Posts: 69
Can you post an example of a URL for which you're getting a 404?

Ed
Mark Bryles
Greenhorn

Joined: Aug 30, 2006
Posts: 2
Sure. A button action on this page http://localhost:8080/myapp/faces/pages/clickme.xhtml displays this 404 message:

HTTP Status 404 - /LoginServlet not found

type Status report

message /LoginServlet not found

description The requested resource (/LoginServlet not found) is not available.
Apache Tomcat/6.0.20

Here are the contents of my WEB-INF/lib directory

activation.jar
axiom-api-1.2.5.jar
axiom-impl-1.2.5.jar
axis.jar
axis2-adb-1.3.jar
axis2-kernel-1.3.jar
commons-codec-1.3.jar
commons-discovery-0.2.jar
commons-httpclient-3.0.1.jar
commons-logging-1.1.jar
jasperreports-3.0.0.jar
jasperserver-common-ws-3.0.0.jar
jaxrpc.jar
jettison-1.1.jar
js_jasperserver-ireport-plugin-3.0.0.jar
js_mail-1.4.jar
jsf-api.jar
jsf-impl.jar
log4j.jar
lib/servlet-api.jar
lib/wsdl4j-1.6.2.jar
lib/xml-apis-ext.jar
lib/xml-apis.jar
XmlSchema-1.3.2.jar

Basically, I need to be able to navigate from a form action to a servlet.

Thanks for the help Ed.

Mark
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: navigation to servlets in JSF 2.0
 
Similar Threads
Chrome JSF Actions Problem
.jsp file becomes .jsf file?
Problem with running web app using JSF
Problem running a simple JSF application
JSF property file's value is not executing