Issue related to the build path configuration

UI Components for JSF
Post Reply
Deepika NS
Posts: 12
Joined: 26 Jul 2011, 08:03

27 Jul 2011, 07:17

Hi,
I was trying to run a sample application using Facelets + JSF + Primefaces 2.2.
I got the example online and was trying to execute the same in eclipse IDE. I tried saving a page as .xhtml (sample.xhtml) and here is the code of the same

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui">

<f:view contentType="text/html" encoding="UTF-8">
<h:head>
   <link type="text/css" rel="stylesheet" href="themes/bluesky/skin.css" />

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
</h:head>
        <h:body>
            <h:form>
                <p:editor/>
            </h:form>
        </h:body>
    </f:view>
</html>
When I try to deploy this using Tomcat 6.0 server, it gives a navigation panel asking me to either save or navigate. How do I run the .xhtml page in Eclipse on the Tomcat Server?

Any help is appreciated.

Thanks
Deep

Deepika NS
Posts: 12
Joined: 26 Jul 2011, 08:03

27 Jul 2011, 07:50

When I tried to create the page as a new JSP file as log.jsp with xhtml markup, this is the exception I'm getting. Kindly help me with the same. :(

HTTP Status 500 -

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

type Exception report

message

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

exception

org.apache.jasper.JasperException: /log.jsp(20,38) #{..} is not allowed in template text
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:102)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:713)
org.apache.jasper.compiler.Node$ELExpression.accept(Node.java:958)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1736)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:183)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:542)
com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:359)
com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:150)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:96)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.

Deepika NS
Posts: 12
Joined: 26 Jul 2011, 08:03

27 Jul 2011, 07:52

This is the code I've written for the same.

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<f:view>
<head>
<link type="text/css" rel="stylesheet" href="themes/bluesky/skin.css" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>First JSP Page</title>
</head>
<body>
<center>
    <p:panel header="Login Form" style="width: 350;">
        <h:form>
            <h:panelGrid columns="2" cellpadding="2">
                <h:outputLabel for="#{userManagedBean.username}" value="UserName"/>
                <h:inputText value="#{userManagedBean.username}" label="UserName"></h:inputText>
                <h:outputLabel for="#{userManagedBean.password}" value="Password"/>
                <h:inputSecret value="#{userManagedBean.password}"></h:inputSecret>
                <h:commandButton type="submit" value="Login" action="#{userManagedBean.login}"></h:commandButton>
            </h:panelGrid>
        </h:form>
    </p:panel>
    <div><h:messages ></h:messages></div>
    </center>
</body>
</f:view>
</html>

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 41 guests