Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

JSF Navigation Issue

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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">
<h:outputLabel rendered="true" for="userName">

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

</h:outputLabel>
<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>

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic