File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Try to open JSF page in MyEclipse/JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Try to open JSF page in MyEclipse/JBoss" Watch "Try to open JSF page in MyEclipse/JBoss" New topic
Author

Try to open JSF page in MyEclipse/JBoss

Francois Bourgault
Ranch Hand

Joined: Oct 30, 2001
Posts: 66
I'm new to JSF and trying to execute some code from the tutorial in Complete Reference JSF. But I'm getting an error when login.jsp is about to be displayed. See code below. Even if I delete <f:view> from login.jsp, it's bombing out on <h:form>. Not sure what I'm missing. I have jstl.jar, standard.jar, jsf-api.jar & jsf-impl.jar in WEB-INF/lib Any idea what's wrong with this code? Thanks.



********************* index.jsp
<html>
<body>
<% response.sendRedirect( "login.faces" ); %>
</body>
</html>
I also tried: <jsp:forward page="/login.faces" /> and I got the same result.


********************* login.jsp
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<f:view>
<html>

<head> <title>MYVTA</title> </head>
<body>
<h:form>
<h2><b>Welcome to My Virtual Training, Please login</b></h2> <hutputText value="Enter your userid.." />
</h:form>
</body>
</html>
</f:view>


********************* 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>

<!-- Navigation rules -->
<navigation-rule>
<description>Login Page</description>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>login</from-outcome>
<to-view-id>/login.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>


and the trace in firefox:
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /login.jsp:5

2: <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
3:
4:
5: <f:view>
6:
7: <html>
8:


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:506)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

java.lang.NullPointerException
javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:929)
javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:310)
org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:70)
org.apache.jsp.login_jsp._jspx_meth_f_view_0(login_jsp.java:86)
org.apache.jsp.login_jsp._jspService(login_jsp.java:62)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
Balaji Natarajan
Greenhorn

Joined: Nov 24, 2007
Posts: 29
hey try putting <f:view> </f:view> within <body> tag.
you need not specify < h t m l> and <body/> tag explicitly. you can remove them at all.
hope this gives you some solution


Best Regards,<br />Balaji Natarajan<br /> <br />SCJP 1.5 100%<br />SCWCD 1.5 92%<br />SCBCD (In Progress)
 
 
subject: Try to open JSF page in MyEclipse/JBoss
 
Threads others viewed
Help! Using Container-managed authentication with JSF
Problems with running JSF in Eclipse 3.1
javax.servlet.jsp.JspException: Not nested in a tag of proper type.
JSF not working in Jboss
Problems in JSF running with MyEclipse
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture