Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 646327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:35:58+00:00 2026-05-13T21:35:58+00:00

I’ve a JSF app deploying from Eclipse Ganymede through Tomcat 6. The latter suggests

  • 0

I’ve a JSF app deploying from Eclipse Ganymede through Tomcat 6. The latter suggests JSP 2.0. I’m using Sun RI JSF implementation and RichFaces 3.3.2SR1.

My index.jsp file on request from the browser causes this error to the console:

05-Mar-2010 12:04:41 org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /index.jsp(35,41) #{..} is not allowed in template text

…

OK, I’ve seen various other posts on this subject including incompatibilities of versions of the various jars/taglibs/syntaxes etc.

The index.jsp is called using http://localhost:8989/myapp/index.jsf (or .jsp – gives the same error), and contains

<ui:composition 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:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">

which should be alright as facelets is in Mojarra 2.0.2FCS which I’m using. I seem to have to use the above syntax rather than eg. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> as the facelets URI causes Eclipse to say Cannot find the tag library descriptor for "http://java.sun.com/jsf/facelets".

Is my problem to do with the way I’m listing these tags?

My Ant build file refers to these Tomcat jars:

    <fileset dir="${cliTomcatlib}">
        <include name="servlet-api.jar" />
        <include name="jsp-api.jar" />
    </fileset>

so I’m stumped as to how I can get round this error. It feels like it would be a simple fix but as I’m using latest jars that should be compatible with JSP 2.0, I’m wondering why I’m getting this error. JSF

EDIT
In response to BalusC’s wisdom, I corrected two references to external jsp files and renamed all .jsp to .xhtml. I remembered to also update my faces-config.xml.

Redeploying now errors with a large and repeating error when the index.xhtml is requested like this:

05-Mar-2010 13:29:26 org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet Faces Servlet threw exception
java.lang.StackOverflowError
    at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:824)
    at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
    at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:544)
...
    at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
    at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:544)
    at com.sun.faces.context.ExternalContextImpl.getSession(ExternalContextImpl.java:151)
    at javax.faces.application.ViewHandler.calculateCharacterEncoding(ViewHandler.java:242)
    at javax.faces.application.ViewHandler.initView(ViewHandler.java:458)
    at com.sun.faces.application.view.MultiViewHandler.initView(MultiViewHandler.java:106)
    at org.ajax4jsf.application.ViewHandlerWrapper.initView(ViewHandlerWrapper.java:128)
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:109)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)

which I admit isn’t very illuminatory other than the first few lines of the stack trace are repeated so many times I had to change the console buffer on Eclipse. I’d be overflowing with gratitude if anyone has seen this before.

Mark

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:35:58+00:00Added an answer on May 13, 2026 at 9:35 pm
    org.apache.jasper.JasperException: /index.jsp(35,41) #{..} is not allowed in template text 
    

    Unified EL is indeed not allowed in template text in JSP. It’s only allowed in Facelets.

    The index.jsp is called using http://localhost:8989/myapp/index.jsf (or .jsp – gives the same error) and contains

    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
         xmlns:ui="http://java.sun.com/jsf/facelets"
    

    You’re mixing up JSP with Facelets. You can and should not to that. Those are two distinct view technologies. Use the one or other. JSP is for the <%@taglib %> stuff and Facelets is XHTML oriented with <html xmlns> and <ui:xxx> stuff. For JSF 2.0 you’re supposed to use Facelets. Rename all files from *.jsp to *.xhtml and replace and get rid of any <% %> and <jsp:xxx> stuff.

    To learn more about Facelets, start here in the Java EE 6 tutorial part II chapter 5. If you’d like to fall back to the ancient JSP instead of Facelets for JSF 2.0, then you’ll need to reconfigure the view handler in JSF.

    Apart from the problem, Tomcat 6.0 is by the way JSP 2.1, not JSP 2.0.

    Update: the StackOverflowError on getSession() indicates an infinite recursion in the servlet/filter mappings. How is your FacesServlet mapped? It should be mapped to listen on an url-pattern of *.jsf, not *.xhtml. Otherwise it will call itself recursively. Please consult/refer the JSF 2.0 books/tutorials/documentation closely how to configure it properly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.