Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

Jeff Rowell
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the web.xml and faces-config.xml

navdeep thakur
Posts: 18
Google App Engine Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic