A few things to examine:
Remember in facelets,
you are using xhtml, which requires all tags to have
an ending, whereas in html you can get away with not doing that… which
could be the problem. Not properly ending all tags can cause pages to not
render.
Are you using the correct jar files for facelets?
Do you have this in your faces-config.xml?
<faces-config>
<application>
<view-handler>
com.sun.facelets.FaceletViewHandler
</view-handler>
</application>
</faces-config>
Also, are you using ADF stuff? This can
cause additional complications and facelets needs to
be configured differently than in the wiki article.
Jeremy Sager
Data Communications
Product Manager
Chesapeake System Solutions
410.356.6805 x120
[EMAIL PROTECTED]
From: Adam Brod
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 21, 2006
12:40 PM
To: MyFaces
Discussion
Subject: Re: MyFAces with FAcelets
That's really a question for the Facelets user group. However,
yes, you can have components in your templates, but you have to be a bit
careful to define the view component to include all the components.
Adam Brod
Product Development Team
|
"Marco Mistroni"
<[EMAIL PROTECTED]>
02/21/2006 12:15 PM
|
|
Hello guys,
ok i figured out what's the problem... it's my template layout
page that has somethign wrong in it..
when i replaced it iwth the template that comes with facelets demo application everything
works fine...
i guess i'll get back here when i will find out what's wrong with my original
template.....
one quick question: can a template include JSF elements? will i have problems?
thanks and regards
marco
On 2/21/06, Marco Mistroni <[EMAIL PROTECTED]> wrote:
hello richard,
thanx for your reply
unfortunately, when i enter pagename.jsf i get following error
type Status report
message /TestJSFApp/main.jsf
description The requested resource
(/TestJSFApp/main.jsf) is not available.
pls note that this was working when i was usingn tiles....... i can't
imagine what could be thep roblem
am i specifying the wrong handler in jsf-config ?
<faces-config>
<application>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<message-bundle>resources.MessageResources</message-bundle>
<view-handler>
com.sun.facelets.FaceletViewHandler
</view-handler>
</application>
.......
</faces-config>
?
thanx and regards
marco
On 2/21/06, Richard Frazer <[EMAIL PROTECTED]>
wrote:
What's the url you are trying to hit? Based on the
web.xml below, you are mapping the faces servlet to *.jsf. The url you
enter should be <pagename>.jsf, not <pagename>.xhtml.
From: Marco
Mistroni <[EMAIL PROTECTED]>
Reply-To: MyFaces Discussion
<[email protected]>
Date: Tue, 21 Feb 2006 16:45:12 +0000
To: MyFaces Discussion
<[email protected]>
Subject: Re: MyFAces with FAcelets
Hello Adam,
when i access main.xhtml, INternet explorer does not 'recongnize' it and
ask me if i want to open the page.....
so, yes, something is not configured properly, but i can' tfigure out what...
it looks like it does not recongize facelets tags at all.. since the text that
is not supposed to be shown
instead it is shown..
here's my main.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd <http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>
">
<html xmlns="
http://www.w3.org/1999/xhtml <http://www.w3.org/1999/xhtml> "
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<body>
<ui:composition
template="/layout/verticalClassicLayout.xhtml"
>
This text will not be displayed.Wrong! iw till be..
<ui:define name="title"
>
BudgetApp version 1.3 - Budget Queries
</ui:define>
This text will also not be displayed.
<ui:define
name="body">
Simple Test for entry
</ui:define>
</ui:composition>
</body>
</html>
here' s again my wbe.xml
<?xml version=" 1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "
http://java.sun.com/dtd/web-app_2_3.dtd <http://java.sun.com/dtd/web-app_2_3.dtd>
">
<web-app >
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/core-context.xml
/WEB-INF/web-context.xml
/WEB-INF/aop-context.xml
/WEB-INF/applicationContext-acegi-security.xml
/WEB-INF/applicationContext-common-authorization.xml
/WEB-INF/applicationContext-common-business.xml
/WEB-INF/faces-context.xml
/WEB-INF/dataSourcePopulator.xml
</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext
</param-name>
<param-value>resources.MessageResources</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-
config.xml,/WEB-INF/faces-managed-beans.xml,/WEB-INF/faces-navigation.xml</param-value>
</context-param>
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>2</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
<description>
Set this flag to true if you want the
JavaServer Faces
Reference Implementation to validate
the XML in your
faces-config.xml resources against the
DTD. Default
value is false.
</description>
</context-param>
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>true</param-value>
<description>
Set this flag to true if you want the
JavaServer Faces
Reference Implementation to verify
that all of the application
objects you have configured
(components, converters,
renderers, and validators) can be
successfully created.
Default value is false.
</description>
</context-param>
<!-- Acegi filters -->
<filter>
<filter-name>Acegi Filter Chain
Proxy</filter-name>
<filter-class>net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
<init-param>
<param-name>targetClass</param-name>
<param-value> net.sf.acegisecurity.util.FilterChainProxy</param-value>
</init-param>
</filter>
<filter>
<filter-name>contextHolderAwareFilter</filter-name>
<filter-class>
net.sf.acegisecurity.util.FilterToBeanProxy</filter-class>
<init-param>
<param-name>targetClass</param-name>
<param-value>net.sf.acegisecurity.wrapper.ContextHolderAwareRequestFilter
</param-value>
</init-param>
</filter>
<filter>
<filter-name>anonymousProcessingFilter</filter-name>
<filter-class>net.sf.acegisecurity.util.FilterToBeanProxy
</filter-class>
<init-param>
<param-name>targetClass</param-name>
<param-value>net.sf.acegisecurity.util.FilterChainProxy</param-value>
</init-param>
</filter>
<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
<init-param>
<param-name>uploadMaxFileSize</param-name>
<param-value>100m</param-value>
<description>Set the size limit
for uploaded files.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
</init-param>
<init-param>
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
<description>Set the threshold
size - files
below this
limit are stored in memory, files above
this limit
are stored on disk.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
</init-param>
<!-- <init-param>
<param-name>uploadRepositoryPath</param-name>
<param-value>/temp</param-value>
<description>Set the path where
the intermediary files will be stored.
</description>
</init-param>-->
</filter>
<!-- JSF-Spring filters -->
<filter>
<filter-name>RequestHandled</filter-name>
<filter-class>de.mindmatters.faces.spring.support.RequestHandledFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Acegi Filter Chain Proxy</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>contextHolderAwareFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>anonymousProcessingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>RequestHandled</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
</filter-mapping>
<!--
To use non XDoclet filter-mappings, create a filter-mappings.xml
file that
contains the additional filter-mappings and place it in your
project's merge dir.
-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>
org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
<listener>
<listener-class>de.mindmatters.faces.spring.support.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>net.sf.acegisecurity.ui.session.HttpSessionEventPublisher</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!--
<servlet>
<servlet-name>TilesServet</servlet-name>
<servlet-class>org.apache.struts.tiles.TilesServlet</servlet-class>
<init-param>
<param-name>definitions-config</param-name>
<param-value>/WEB-INF/tiles-
defs.xml</param-value>
</init-param>
<init-param>
<param-name>definitions-parser-validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
-->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<!--
To specify mime mappings, create a file named mime-mappings.xml, put it
in your project's mergedir.
Organize mime-mappings.xml following this DTD slice:
<!ELEMENT mime-mapping (extension, mime-type)>
-->
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<!--
To specify error pages, create a file named error-pages.xml , put it in
your project's mergedir.
Organize error-pages.xml following this DTD slice:
<!ELEMENT error-page ((error-code | exception-type), location)>
-->
<!-- Struts-EL Tag Library Descriptors -->
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://worldcorp.co.uk/jsf/component/tags</taglib-uri>
<taglib-location>/WEB-INF/tld/jsfapp.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
</taglib>
<!--
To set up security settings for your web app, create a file named
web-security.xml, put it in your project's mergedir.
Organize web-security.xml following this DTD slice:
<!ELEMENT security-constraint (display-name?,
web-resource-collection+, auth-constraint?, user-data-constraint?)>
<!ELEMENT web-resource-collection (web-resource-name, description?,
url-pattern*, http-method*)>
<!ELEMENT web-resource-name (#PCDATA)>
<!ELEMENT url-pattern (#PCDATA)>
<!ELEMENT http-method (#PCDATA)>
<!ELEMENT user-data-constraint (description?,
transport-guarantee)>
<!ELEMENT transport-guarantee (#PCDATA)>
<!ELEMENT login-config (auth-method?, realm-name?,
form-login-config?)>
<!ELEMENT auth-method (#PCDATA)>
<!ELEMENT realm-name (#PCDATA)>
<!ELEMENT form-login-config (form-login-page, form-error-page)>
<!ELEMENT form-login-page (#PCDATA)>
<!ELEMENT form-error-page (#PCDATA)>
-->
<security-role>
<role-name>root</role-name>
</security-role>
</web-app>
hope you can still help me out....
thanks and regards
marco