aspose file tools*
The moose likes JSF and the fly likes cannot forward to jsf page - unable to resolve jsf tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "cannot forward to jsf page - unable to resolve jsf tag" Watch "cannot forward to jsf page - unable to resolve jsf tag" New topic
Author

cannot forward to jsf page - unable to resolve jsf tag

srinivas srini
Greenhorn

Joined: Feb 03, 2004
Posts: 23
am a beginner to JSF , I am getting the following error when I try to invoke using the following URL

http://localhost:8080/Loginjsf/

I have copied web.xml,faces-config.xml,index.jsp, userLogin.jsp and also the list of jars I am using.
java version I am using jdk1.5.0_14
tomcat version 5.5.25
JSF Version 1.1_01

---------------------------------------------------------------------this is the error------------------------------------------------------------------
exception

org.apache.jasper.JasperException: Exception in JSP: /index.jsp:7

4: </head>
5: <body>
6: </body>
7: <jsp:forward page="userLogin.jsp"></jsp:forward>
8: </html>

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

org.apache.jasper.JasperException: Exception in JSP: /userLogin.jsp:15

12: </head>
13:
14: <body>
15: <f:view>
16: <h:form id="UserName">
17: <f:loadBundle basename ="com.demo.MessageBundle" var="bundle"/>
18: <h:inputText></h:inputText>


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
org.apache.jsp.index_jsp._jspService(index_jsp.java:50)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

javax.servlet.ServletException: Cannot find FacesContext
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.userLogin_jsp._jspService(userLogin_jsp.java:92)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
org.apache.jsp.index_jsp._jspService(index_jsp.java:50)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

javax.servlet.jsp.JspException: Cannot find FacesContext
javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:399)
com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:105)
org.apache.jsp.userLogin_jsp._jspx_meth_f_005fview_005f0(userLogin_jsp.java:107)
org.apache.jsp.userLogin_jsp._jspService(userLogin_jsp.java:82)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
org.apache.jsp.index_jsp._jspService(index_jsp.java:50)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)




--------------------------------------------------------------------------------
THE WEB.XML FILE I AM USING IS

The web.xml, faces-config.xml files which I am using ,
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
<description>
Set this flag to true if you want the JavaServer Faces
Reference Implementation to validate the XML in your
faces-config.xml resources against the DTD. Default
value is false.
</description>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!--Tomcat 5 Workaround: Listener used to initialize JSF on startup-->
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
</web-app>

--------------------------------------------------------------------------------

THE FACES-CONFIG.XML I AM USING
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

<faces-config >
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
<managed-bean>
<managed-bean-name>UserBean</managed-bean-name>
<managed-bean-class>com.demo.bean.UserBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>userName</property-name>
<property-class>java.lang.String</property-class>
<value></value>
</managed-property>
<managed-property>
<property-name>password</property-name>
<property-class>java.lang.String</property-class>
<value></value>
</managed-property>
</managed-bean>
<navigation-rule>
<from-view-id>/userLogin.jsp</from-view-id>
<navigation-case><from-outcome>failure</from-outcome>

<to-view-id>/loginForm.jsp</to-view-id>
</navigation-case>

<navigation-case>
<from-action>success</from-action>
<to-view-id>/userLoginSuccess.jsp</to-view-id>
</navigation-case></navigation-rule>
<navigation-rule>
<from-view-id>/userLoginSuccess.jsp</from-view-id>
</navigation-rule>
<navigation-rule>
<from-view-id>/loginForm.jsp</from-view-id>
</navigation-rule>

</faces-config>

--------------------------------------------------------------------------------
THE INDEX.JSP I AM USING

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
</head>
<body>
</body>
<jsp:forward page="userLogin.jsp"></jsp:forward>
</html>


--------------------------------------------------------------------------------
THE USERLOGIN.JSP is

<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/WEB-INF/html_basic.tld" prefix="h"%>
<%@ taglib uri="/WEB-INF/jsf_core.tld" prefix="f"%>

<html>
<head>
<title>My JSF 'userLogin' starting page</title>
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>

<body>
<f:view>
<h:form id="UserName">
<f:loadBundle basename ="com.demo.MessageBundle" var="bundle"/>
<h:inputText></h:inputText>
<hutputLabel value="UserName"></hutputLabel>
<h:inputText></h:inputText>
<hutputLabel for="Password" value="Password" id="Password"></hutputLabel>
</h:form>
</f:view>
</body>
</html>


--------------------------------------------------------------------------------
THE JAR FILES LOCATED AT tomcat-5.5\webapps\Loginjsf\WEB-INF\lib
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
el-api.jar
el-ri.jar
jsf-api.jar
jsf-facelets.jar
jsf-impl.jar
jstl.jar
standard.jar

It would be great if you could help me in resolving this problem, what is that I am doing wrong?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61238
    
  66

"srinivas k",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dushyant Agarwal
Ranch Hand

Joined: Oct 14, 2007
Posts: 75
Hi,
First of all the issue of changing the display name is unnecessary. The display name absolutely correct according to the ranch rules.

display name must be a first and a last name separated by a space character, and must not be obviously fictitious.


FYI,Bear the said name is purely traditional Indian name and further critics on this would be offensive.

As for the Exception,Srinivas, this exception would be removed if we used <jsp:forward page="/userLogin.jsp">

As well as try the URL http://localhost:8080/Loginjsf/index.faces[/URL]
[ April 15, 2008: Message edited by: Dushyant Agarwal ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: cannot forward to jsf page - unable to resolve jsf tag