I'm having a great deal of dificulty in gettting started with
JSF development. I've followed a few online tutorials and have managed to get a very simple JSF application to work using Eclipse and Apache
Tomcat 6.0.26. Unfotunately, however, when I try to reference a backing bean the page fails to load. I receive a HTTP 500 error and the following message "org.apache.jasper.JasperException: /hello.jsp(19,25) #{...} is not allowed in template text".
I've seen other posts related to this error (including on this forum), but have not been able to make any sense of them - i.e. its not clear to me what the root cause is and what corrective action to take.
The tutorial that I was working through when I encountered this error is "Essential JSF, Facelets &
JBoss Seam" - this asked me to download and configure the following libraries within Eclipse:
- The SUN reference implementation of
Java Server Faces - i.e. the 2.0.2 binary bundle of the "Project Mojarra".
- The JSTL library from
https://maven-repository.dev.java.net/repository/jstl/jars
These libraries were then added to the Exlipse preferences... in an effort to get things to work I also added the jsf-api.jar, jsf-impl.jar, and jstl-1.2.jar files to the WEB-INF/lib folder of my project...
If anyone can help me understand what I'm doing wrong I'd greately appreciate it - am I missing some library, do I need to somehow need to configure something else in Apache?
My hello.jsp is:
<?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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
</head>
<body>
<f:view>
<h:form>
<h:panelGrid border="1" columns="2">
<h:outputText value="Name"></h:outputText>
<h:inputText value="#{loginBean.name}"></h:inputText>
<h:outputText value="Password"></h:outputText>
<h:inputSecret value="#{loginBean.password}"></h:inputSecret>
</h:panelGrid><h:commandButton value="Login" action="login"></h:commandButton>
</h:form>
</f:view>
</body>
</html>