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 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark ""#{...} is not allowed in template text" error" Watch ""#{...} is not allowed in template text" error" New topic
Author

"#{...} is not allowed in template text" error

Jeff Rowell
Greenhorn

Joined: May 13, 2010
Posts: 1
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">
<hutputText value="Name"></hutputText>

<h:inputText value="#{loginBean.name}"></h:inputText>
<hutputText value="Password"></hutputText>
<h:inputSecret value="#{loginBean.password}"></h:inputSecret>
</h:panelGrid><h:commandButton value="Login" action="login"></h:commandButton>

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

</body>
</html>
Pradeep Katipamula
Ranch Hand

Joined: May 11, 2010
Posts: 37
Can you post the web.xml and faces-config.xml

Thanks
Pradeep
navdeep thakur
Greenhorn

Joined: May 09, 2007
Posts: 18

Hi Guys,

Even i have the same problem.

Here are my environment details:

JSF: 1.2.9
RichFaces: 3.3.3
Application Server: Tomcat 6.0.29
JRE: 6


Exception which I got:



Here is my include.jsp Page where i have importing tag libs



Here is my manageUser.jsp where i am using <a4j:commandButton>



Here is web.xml of my project



Here is faces-config.xml of my project




Please help me out, it stops my work.

thanks


Navdeep Thakur alias Navi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: "#{...} is not allowed in template text" error
 
Similar Threads
how to add a row dynamically in panel grid by clicking on command button using jsf
Javascript reset() method and JSF h:form
Error while accessing hibernate session through JSF
javax.servlet.jsp.JspException: Not nested in a tag of proper type.
managed bean in JSF.