aspose file tools*
The moose likes JSF and the fly likes JSF Navigation Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF Navigation Issue" Watch "JSF Navigation Issue" New topic
Author

JSF Navigation Issue

Wasif Kirmani
Greenhorn

Joined: Sep 19, 2008
Posts: 3
Dear All Frnds:

I am new to JSF and i have created an EAR application contains JSF/Hibernate
but in my case when i try to access my application's JSP page then it works fine but when i try to open those pages contain jsf taglib they give me an error that this page can not be displayed.

What could be the issue.. the below code works fine as it doesn't contain any JSF Taglib tag in header..


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language="java" %>
<%@ page import="java.util.ArrayList"%>
<%!
ArrayList errors;
%>
<%
errors = (ArrayList)request.getAttribute("errors");
%>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="IBM WebSphere Studio">
<title>
Trader-Errors
</title>
</head>
<body>
<h1>
<b>
<font face="Arial">
TraderWeb
</font>
</b>
</h1>
<p>
<font face="Arial">
<b>
Errors
</b>
<br>
<% if (errors == null) {
out.write("No Errors Found.");
} else {
for (int i=0; i < errors.size(); i++) {
out.write(i + ": " + (String)errors.get(i) + "<br>");
}
}
%>
</font>
</body>
</html>



but issue is related to this file

<%@ page language="java" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>My JSF 'userLogin.' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

</head>

<body>
<f:view>
<f:loadBundle basename="com.kiosk.clientname.resources.ApplicationResource" var="bundle"/>
<h:form id="loginForm" rendered="true">
<hutputLabel rendered="true" for="userName">

</hutputLabel>
<h:inputText value="#{up_User.objUpUser.userScreenName}" rendered="true"
required="true" id="userName" />
<br>
<hutputLabel rendered="true" for="password">

</hutputLabel>
<h:inputSecret value="#{up_User.objUpUser.userPassword}" rendered="true"
required="true" redisplay="false" id="password" />
<br>
<h:commandButton value="Login}" rendered="true"
action="#{up_User.loginUser}" id="submit" /> 

</h:form></f:view>
</body>
</html>



Urgent help will be appreciated...

also including faces-config.xml



<?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>
<managed-bean>
<managed-bean-name>up_User</managed-bean-name>
<managed-bean-class>com.kiosk.clientname.backingbean.Up_User</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>objUpUser</property-name>
<property-class>com.kiosk.clientname.entity.AdmUpUser</property-class>
<value/>
</managed-property>
</managed-bean>
<navigation-rule>
<from-view-id>/jsp/userLogin.jsp</from-view-id>
<navigation-case>
<from-outcome>failure</from-outcome>
<to-view-id>/jsp/userLogin.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/jsp/home.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
</faces-config>




web.xml

<?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>
<display-name>AdminWeb</display-name>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/jsp/userLogin.jsp</welcome-file>
</welcome-file-list>
<security-constraint>
<!-- This security constraint illustrates how JSP pages
with JSF components can be protected from
being accessed without going through the Faces Servlet.
The security constraint ensures that the Faces Servlet will
be used or the pages will not be processed. -->
<display-name>Restrict access to JSP pages</display-name>
<web-resource-collection>
<web-resource-name>Restrict access to JSP pages</web-resource-name>
</web-resource-collection>
<auth-constraint>
<description>With no roles defined, no access granted</description>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app>
venkatesh babu
Greenhorn

Joined: Sep 20, 2008
Posts: 6
Hi

It would be great if you could post any further information on this.. Do you see an error in your console? Is it a 404/500 error? Are you using jsf 1.2 ?DO you have jsf-api.jar and the jsf-impl.jar in your classpath and any dependent jars?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF Navigation Issue