• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

#{..} is not allowed in template text

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I was trying to build a basic JSF application in eclipse to be able to extend a simple framework whenever I would need it.
However, the JSPs I copied from my last webapp (they worked there) throw an exception when I load them.

I read several posts and this seems to be a problem with versions of JSTL libraries and JSF implementations (?)

I built a 2.5 dynamic web application with eclipse build 20090920-1017,
added Facets for JSF 1.2 (eclipse downloaded the Sun RI implementation) and
added the JSTL.jar and Standard.jar from the Jakarta Project, version 1.1.2

JSF and JSTL libraries are being exported and selected in the Java EE Module dependencies.

The only page I created so far is the following:

users.jsp


The project was then built and deployed to Apache Tomcat 6.0.20 with the following configs:
web.xml

faces-config.xml

When I start the server and open http://localhost:8080/BaseWeb/faces/users.jsp I receive the exception output.

Can anyone please tell me what the problem is with my mess?

Thank you for your help
Robert
 
Saloon Keeper
Posts: 28713
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your URL is "users.jsp" and the view template file is also named "users.jsp", it sounds like you're not routing JSF properly. Normally the URL would either be something like "/faces/users.jsp" or "/users.jsf".

There's nothing obviously wrong with the view definition itself.
 
Ranch Hand
Posts: 30
Hibernate Eclipse IDE Oracle
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Robert,

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.

just remove the Xmlns from jsp page

<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">


and now add tag lib for jsp page..

<%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

It will definitely solve your problem.

Cheers..
Prateek Singh
 
reply
    Bookmark Topic Watch Topic
  • New Topic