File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark ""#{...} is not allowed in template text" error" Watch ""#{...} is not allowed in template text" error" New topic

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

Jeff Rowell

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

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"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns=""
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>

<h:panelGrid border="1" columns="2">
<hutputText value="Name"></hutputText>

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


Pradeep Katipamula
Ranch Hand

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

navdeep thakur

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.


Navdeep Thakur alias Navi
I agree. Here's the link:
subject: "#{...} is not allowed in template text" error
It's not a secret anymore!