Shale + tiles
Hi, I've to do a new web application and I think about jsf+shale+tiles.
Someone could point me to an example about shale-tiles integration, I do some pages but I get a DispatchError...
Thanks
lussoluca
first make sure you are using Tiles stand-alone (in Struts Sandbox)
add the follwoing servlet to your web.xml
<servlet>
<servlet-name>Tiles Servlet</servlet-name>
<servlet-class>org.apache.tiles.servlet.TilesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
add the following context-param to your web.xml
<context-param>
<param-name>tiles-definitions</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
add the following to your faces-config.xml
<view-handler>org.apache.shale.tiles.TilesViewHandler</view-handler>
add the following dependency to your pom.xml
<dependency>
<groupId>org.apache.shale</groupId>
<artifactId>shale-tiles</artifactId>
<version>1.0.3</version>
</dependency>
that should be it.
Khaled
Similar Messages
-
JSF 1.1 integration with shale-tiles-1.0.4 giving page cannot be displayed
I am trying to get shale-tiles-1.0.4 work with JSF 1.1
I am getting the page can not be displayed error.
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.
Please try the following:
Open the 10.21.31.170:8988 home page, and then look for links to the information you want.
Click the Refresh button, or try again later.
Click Search to look for information on the Internet.
You can also see a list of related sites.
HTTP 500 - Internal server error
Internet Explorer
These are the steps I have followed
I have included shale-core-1.0.4.jar and shale-tiles-1.0.4.jar in /WEB-INF/lib
I have included the following entry in web.xml
<servlet>
<servlet-name>Tiles Servlet</servlet-name>
<servlet-class>org.apache.tiles.servlets.TilesServlet;/servlet-class>
<init-param>
<param-name>definitions-config</param-name>
<param-value>/WEB-INF/tiles-defs.xml;/param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<context-param>
<param-name>definitions-config</param-name>
<param-value>/WEB-INF/tiles-defs.xml;/param-value>
</context-param>
<listener>
<listener-class>
org.apache.tiles.listener.TilesListener
</listener-class>
</listener>
My tiles-defs.xml:
<tiles-definitions>
<definition name="/siteMainLayout" path="/tiles/layout.jsp";>
<put name="header" value="/tiles/header.jsp";/>
<put name="menu" value="/tiles/menu.jsp";/>
<put name="content" value=""/>
</definition>
<definition name="/systemLogon" extends="/siteMainLayout">
<put name="content" type="template" value="/welcome.jsp";/>
</definition>
<definition name="/systemChangePwd" extends="/siteMainLayout">
<put name="content" type="template" value="/application/changePassword.jsp";/>
</definition>
<definition name="/systemMain" extends="/siteMainLayout">
<put name="content" type="template" value="/application/mainPage.jsp";/>
</definition>
<definition name="/systemFailue" extends="/siteMainLayout">
<put name="content" type="template" value="/failue.jsp";/>
</definition>
<definition name="/systemMain" extends="/siteMainLayout">
<put name="content" type="template" value="/application/mainPage.jsp";/>
</definition>
<definition name="/systemCancel" extends="/siteMainLayout">
<put name="content" type="template" value="/application/Misc.jsp";/>
</definition>
</tiles-definitions>
My layout.jsp:
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles"%>
<h:panelGrid columns="2">
<f:facet name="header">
<f:subview id="header">
<tiles:insert name="header" flush="false"/>
</f:subview>
</f:facet>
<f:subview id="menu">
<tiles:insert name="menu" flush="false"/>
</f:subview>
<f:subview id="content">
<tiles:insert name="content" flush="false"/>
</f:subview>
</h:panelGrid>
My faces-config.xml:
<faces-config xmlns="http://java.sun.com/JSF/Configuration">
<managed-bean>
<managed-bean-name>backing_Welcome</managed-bean-name>
<managed-bean-class>state.mn.mdh.mrc.login.Welcome;/managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<!--oracle-jdev-comment:managed-bean-jsp-link:1Welcome.jspx-->
</managed-bean>
<application>
<view-handler>
org.apache.shale.tiles.TilesViewHandler
</view-handler>
</application>
<navigation-rule>
<from-view-id>/systemLogon.jsp;/from-view-id>
<navigation-case>
<from-outcome>ChangePassword</from-outcome>
<to-view-id>/systemChangePwd</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>LoginSuccess</from-outcome>
<to-view-id>/systemMain</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>Others</from-outcome>
<to-view-id>/systemCancel</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-outcome>Failure</from-outcome>
<to-view-id>/systemFailue</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
My systemLogon.jsp:
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles"%>
<html>
<f:view>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
<title>System Logon</title>
</head>
<body>
<f:subview id="content">
<h:form>
<tiles:insert name="content" flush="false">
</tiles:insert>
</h:form>
</f:subview>
</body>
</f:view>
</html>
The url I am trying is http://10.21.31.170:8988/Test-ViewController-context-root/faces/systemLogon.jsp
Please assist in what I am missing.
Thanks,
AmbikaHi
I do not see any error messages on the application server log except the server initialized message( I have included that at the end)
But when I run the application in Firefox browser it gives me this error,
Error instantiating web-application
Error loading listener 'org.apache.tiles.listener.TilesListener', class not found
When I removed the <listener> entry from web.xml and get the error,
Error instantiating web-application
Error instantiate servlet classes
The message in Jdeveloper is:
[Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
C:\jdevstudio10133\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config>
C:\jdevstudio10133\jdk\bin\javaw.exe -client -classpath C:\jdevstudio10133\j2ee\home\oc4j.jar;C:\jdevstudio10133\jdev\lib\jdev-oc4j-embedded.jar -Xverify:none -XX:MaxPermSize=256m -DcheckForUpdates=adminClientOnly -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config C:\jdevstudio10133\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\server.xml
[waiting for the server to complete its initialization...]
Could not canonicalize '"C:\Program Files\Sybase\Adaptive Server Anywhere 6.0\win32"' (The filename, directory name, or volume label syntax is incorrect). From system property java.library.path.
Jun 13, 2008 10:18:21 AM oracle.security.jazn.JAZNConfig parseJAZNConfig
FINE: JAAS: Configuration properties: { location = system-jazn-data.xml, provider.type = XML, realm.default = jazn.com }
Jun 13, 2008 10:18:21 AM oracle.security.jazn.JAZNConfig parseJAZNConfig
FINE: JAAS: Configuration properties: { provider.type = XML }
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig parseJAZNConfig
FINE: JAAS: Configuration properties: { provider.type = XML }
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig parseJAZNConfig
FINE: JAAS: Configuration properties: { location = TestWithShaleTiles-jazn-data.xml, provider.type = XML, realm.default = jazn.com }
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: Configuration properties: { location = system-jazn-data.xml, deployment.url = file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/system-application.xml, provider.type = XML, realm.default = jazn.com }
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): deployment URL=file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/system-application.xml
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): classpath=null
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): this=[JAZNConfig file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/system-application.xml]
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig fileExists
FINE: JAAS: Verify file=C:\jdevstudio10133\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\jazn.xml
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig getDefaultJAZNConfigFilePath
FINE: JAAS: Configuration file=C:\jdevstudio10133\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\jazn.xml
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig getJAZNProperties
FINE: JAAS: Configuration file=C:\jdevstudio10133\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\jazn.xml
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig parseJAZNConfig
FINE: JAAS: Configuration properties: { idm.token.type = HTTP_COOKIE, custom.sso.key.alias = ssoSymmetricKey, idm.token.asserter.class = oracle.security.jazn.sso.SSOCookieTokenAsserter, realm.default = jazn.com, custom.sso.url.login = /jsso/SSOLogin, provider.type = XML, custom.sso.url.logout = /jsso/SSOLogout, idm.token.collector.class = oracle.security.jazn.sso.SSOCookieTokenCollector, location = ./system-jazn-data.xml, idm.authentication.name = JavaSSO, idm.token.collector.cookie.1 = ORA_OC4J_SSO }
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: Configuration properties: { idm.token.type = HTTP_COOKIE, custom.sso.key.alias = ssoSymmetricKey, idm.token.asserter.class = oracle.security.jazn.sso.SSOCookieTokenAsserter, realm.default = jazn.com, deployment.url = file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/jazn.xml, custom.sso.url.login = /jsso/SSOLogin, provider.type = XML, custom.sso.url.logout = /jsso/SSOLogout, idm.token.collector.class = oracle.security.jazn.sso.SSOCookieTokenCollector, location = ./system-jazn-data.xml, idm.authentication.name = JavaSSO, idm.token.collector.cookie.1 = ORA_OC4J_SSO }
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): deployment URL=file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/jazn.xml
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): classpath=null
Jun 13, 2008 10:18:22 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): this=[JAZNConfig file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/jazn.xml]
Jun 13, 2008 10:18:22 AM oracle.security.jazn.spi.xml.XMLJAZNProvider getJAZNDataXMLDoc
FINE: JAAS-XML: url=file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/system-jazn-data.xml fname=file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/system-jazn-data.xml file=C:\jdevstudio10133\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\system-jazn-data.xml
Jun 13, 2008 10:18:22 AM oracle.security.jazn.spi.xml.XMLRealmUser init
FINE: JAZN-XML: XMLRealmUser.init: user(anonymous) is deactivated.
Jun 13, 2008 10:18:22 AM oracle.security.jazn.spi.xml.XMLJACCRepository init
FINE: JACC: jaccRepo.init - JACCRepository already initialized. repo=[XMLJACCRepository isValid=true
jaznConfig=[JAZNConfig file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/jazn.xml]
jaccPolicyMap.keySet=[]
jaccPolicyMap.values=[]] node=oracle.xml.parser.v2.XMLElement@170984c
Jun 13, 2008 10:18:22 AM oracle.security.jazn.spi.xml.XMLUserManager getAdminUser
FINE: JAZN-XML: UserManager.getAdminUser: admin.user=oc4jadmin
Jun 13, 2008 10:18:22 AM oracle.security.jazn.oc4j.RealmUserManager getAdminUser
FINE: JAZN-OC4J: RealmUserManager.getAdminUser()=RealmUser: oc4jadmin
Jun 13, 2008 10:18:23 AM com.evermind.server.jms.JMSMessages log
INFO: JMSServer[]: OC4J JMS server recovering transactions (commit 0) (rollback 0) (prepared 0).
Jun 13, 2008 10:18:23 AM com.evermind.server.jms.JMSMessages log
INFO: JMSServer[]: OC4J JMS server recovering local transactions Queue[jms/Oc4jJmsExceptionQueue].
Jun 13, 2008 10:18:23 AM oracle.oc4j.security.SSLMessages logGetSecureSocket
FINE: getSecureSocket(address=/0.0.0.0, port=24043, backlog=30)
Jun 13, 2008 10:18:23 AM oracle.oc4j.security.SSLMessages logGetSecureSocket
FINE: getSecureSocket(address=/0.0.0.0, port=24043, backlog=30)
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: Configuration properties: { deployment.url = file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/application.xml, provider.type = XML }
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): deployment URL=file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/application.xml
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): classpath=null
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): this=[JAZNConfig file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/config/application.xml]
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: Configuration properties: { deployment.url = file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/application-deployments/datatags/, provider.type = XML }
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): deployment URL=file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/application-deployments/datatags/
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): classpath=null
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): this=[JAZNConfig file:/C:/jdevstudio10133/jdev/system/oracle.j2ee.10.1.3.41.57/embedded-oc4j/application-deployments/datatags/]
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: Configuration properties: { location = TestWithShaleTiles-jazn-data.xml, deployment.url = file:/C:/jdevstudio10133/jdev/mywork/Test_Tiles/Test_with_shale_tiles/TestWithShaleTiles-oc4j-app.xml, provider.type = XML, realm.default = jazn.com }
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): deployment URL=file:/C:/jdevstudio10133/jdev/mywork/Test_Tiles/Test_with_shale_tiles/TestWithShaleTiles-oc4j-app.xml
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): classpath=null
Jun 13, 2008 10:18:25 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): this=[JAZNConfig file:/C:/jdevstudio10133/jdev/mywork/Test_Tiles/Test_with_shale_tiles/TestWithShaleTiles-oc4j-app.xml]
Jun 13, 2008 10:18:25 AM oracle.security.jazn.spi.xml.XMLJAZNProvider getJAZNDataXMLDoc
FINE: JAAS-XML: url=file:/C:/jdevstudio10133/jdev/mywork/Test_Tiles/Test_with_shale_tiles/TestWithShaleTiles-jazn-data.xml fname=file:/C:/jdevstudio10133/jdev/mywork/Test_Tiles/Test_with_shale_tiles/TestWithShaleTiles-jazn-data.xml file=C:\jdevstudio10133\jdev\mywork\Test_Tiles\Test_with_shale_tiles\TestWithShaleTiles-jazn-data.xml
Jun 13, 2008 10:18:26 AM oracle.security.jazn.util.Misc findOracleHome
FINE: JAAS: ORACLE_HOME=C:\jdevstudio10133
Jun 13, 2008 10:18:26 AM oracle.security.jazn.util.Misc fileExists
FINE: JAAS: Verify file=C:\jdevstudio10133\j2ee\home\config\jazn.xml
Jun 13, 2008 10:18:26 AM oracle.security.jazn.util.Misc getJ2eeHomeJAZNConfigFilePath
FINE: JAAS: Bootstrap jazn.xml @C:\jdevstudio10133\j2ee\home\config\jazn.xml
Jun 13, 2008 10:18:26 AM oracle.security.jazn.JAZNConfig <init>
FINE: JAAS: Configuration file=C:\jdevstudio10133\j2ee\home\config\jazn.xml
Jun 13, 2008 10:18:26 AM oracle.security.jazn.JAZNConfig getJAZNProperties
FINE: JAAS: Configuration file=C:\jdevstudio10133\j2ee\home\config\jazn.xml
Jun 13, 2008 10:18:26 AM oracle.security.jazn.JAZNConfig parseJAZNConfig
FINE: JAAS: Configuration properties: { idm.token.type = HTTP_COOKIE, custom.sso.key.alias = ssoSymmetricKey, idm.token.asserter.class = oracle.security.jazn.sso.SSOCookieTokenAsserter, realm.default = jazn.com, custom.sso.url.login = /jsso/SSOLogin, provider.type = XML, custom.sso.url.logout = /jsso/SSOLogout, idm.token.collector.class = oracle.security.jazn.sso.SSOCookieTokenCollector, location = ./system-jazn-data.xml, idm.authentication.name = JavaSSO, idm.token.collector.cookie.1 = ORA_OC4J_SSO }
Jun 13, 2008 10:18:26 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: Configuration properties: { idm.token.type = HTTP_COOKIE, custom.sso.key.alias = ssoSymmetricKey, idm.token.asserter.class = oracle.security.jazn.sso.SSOCookieTokenAsserter, realm.default = jazn.com, deployment.url = file:/C:/jdevstudio10133/j2ee/home/config/jazn.xml, custom.sso.url.login = /jsso/SSOLogin, provider.type = XML, custom.sso.url.logout = /jsso/SSOLogout, idm.token.collector.class = oracle.security.jazn.sso.SSOCookieTokenCollector, location = ./system-jazn-data.xml, idm.authentication.name = JavaSSO, idm.token.collector.cookie.1 = ORA_OC4J_SSO }
Jun 13, 2008 10:18:26 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): deployment URL=file:/C:/jdevstudio10133/j2ee/home/config/jazn.xml
Jun 13, 2008 10:18:26 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): classpath=null
Jun 13, 2008 10:18:26 AM oracle.security.jazn.JAZNConfig init
FINE: JAAS: JAZNConfig.init(): this=[JAZNConfig file:/C:/jdevstudio10133/j2ee/home/config/jazn.xml]
Jun 13, 2008 10:18:26 AM oracle.security.jazn.util.Misc initJ2eeHomeJAZNConfig
FINE: JAAS: default jazn.xml @ C:\jdevstudio10133\j2ee\home\config\jazn.xml : [JAZNConfig file:/C:/jdevstudio10133/j2ee/home/config/jazn.xml]
Jun 13, 2008 10:18:26 AM oracle.security.jazn.util.Misc getIASPropertiesFilePath
FINE: JAAS: XML Provider
Jun 13, 2008 10:18:27 AM oracle.security.jazn.util.Misc getIASPropertiesFilePath
FINE: JAAS: XML Provider
Ready message received from Oc4jNotifier.
Embedded OC4J startup time: 9375 ms.
Target URL -- http://10.21.31.170:8988/Test-ViewController-context-root/faces/systemLogon.jsp
08/06/13 10:18:28 Oracle Containers for J2EE 10g (10.1.3.3.0) initialized
Jun 13, 2008 10:18:29 AM oracle.security.jazn.util.Misc getIASPropertiesFilePath
FINE: JAAS: XML Provider
Thanks for your help,
Ambika -
JSF 1.2 + Shale Tiles Example needed
Hello,
I'm trying to develop application by using jsf 1.2 and Shale tiles. I have a problem with configuration. I was working before with Struts Tiles and MyFaces but it isn't the same.
Can somebody provide my some exanle simle aplication of using Shale Tiles and JSF 1.2?
Thx.To make templates in JSF we use Facelets here. I think Tiles = Strus , Facelets = JSF.
Cya. -
JSF 1.2 + Shale Tiles
Hi,
I'm developing webapp with JSF 1.2 and Tiles. I think that I made everythig corect but when I'm running tha app I get following error:
java.lang.IllegalStateException: Component javax.faces.component.UIViewRoot@67ec28 not expected type. Expected: javax.faces.component.UICommand. Perhaps you're missing a tag?
com.sun.faces.taglib.html_basic.CommandLinkTag.setProperties(CommandLinkTag.java:259)
javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:604)
javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1111)
com.sun.faces.taglib.html_basic.CommandLinkTag.doStartTag(CommandLinkTag.java:364)
org.apache.jsp.common.welcome_jsp._jspx_meth_h_005fcommandLink_005f0(welcome_jsp.java:124)
org.apache.jsp.common.welcome_jsp._jspService(welcome_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:384)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:413)
com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:410)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:112)
org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:243)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
Can somebody help? Thx.This is my layout:
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
<title>Music Store</title>
</head>
<f:view>
<body>
<table border="1" width="100%" cellspacing="5" height="100%">
<tr>
<td colspan="3" width="100%">
<f:subview id="header">
<tiles:insert attribute="header" flush="false"/>
</f:subview>
</td>
</tr>
<tr>
<td colspan="3" width="100%">
<f:subview id="menu">
<tiles:insert attribute="menu" flush="false"/>
</f:subview>
</td>
</tr>
<tr>
<td width="20%" valign="top" align="center">
<tiles:insert attribute="search" flush="false"/>
</td>
<td width="*" align="center" valign="top">
<f:subview id="body">
<tiles:insert attribute="body" flush="false"/>
</f:subview>
</td>
<td width="20%" valign="top" align="center">
<tiles:insert attribute="special" flush="false"/>
</td>
</tr>
<tr>
<td colspan="3" width="100%">
<tiles:insert attribute="footer" flush="false"/>
</td>
</tr>
</table>
</body>
</f:view>
</html>
This is tiles-defs:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<definition name="layoutLanguage" path="/common/layout.jsp">
<put name="header" value="" />
<put name="menu" value="" />
<put name="special" value="" />
<put name="search" value="" />
<put name="footer" value="" />
</definition>
<definition name="layout" path="/common/layout.jsp">
<put name="header" value="" />
<put name="menu" value="/common/menu.jsp" />
<put name="special" value="" />
<put name="search" value="" />
<put name="footer" value="" />
</definition>
<definition name="/common/welcome.tiles" extends="layout">
<put name="body" value="/common/welcome.jsp" />
</definition>
<definition name="/pages/createAccount.tiles" extends="layout">
<put name="body" value="/pages/createAccount.jsp" />
</definition>
</tiles-definitions>
This is web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<!-- Tiles ViewHandler config file -->
<context-param>
<param-name>tiles-definitions</param-name>
<param-value>/WEB-INF/tiles-defs.xml</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
</web-app>
This is faces-config:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<application>
<view-handler>
org.apache.shale.tiles.TilesViewHandler
</view-handler>
</application>
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>createAccount</from-outcome>
<to-view-id>/pages/createAccount.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<managed-bean>
<managed-bean-name>LocaleBean</managed-bean-name>
<managed-bean-class>
com.MusicStore.managedBeans.LocaleBean
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>CreateAccountBean</managed-bean-name>
<managed-bean-class>
com.MusicStore.managedBeans.CreateAccountBean
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>
When I include f:view or f:subview in welcome.jsp the page appears but withput tiles. Maybe my layout is wrog. I was using this kind of layout durng myfaces development. -
Hello,
can someone help me to sort it out. I'm trying to get tiles working with shale.
I've shale-blank (their example 1.0.4 version) working fine under tomcat 5.5, also I have tiles-test (example 2.0.3 version) working fine.
Now I'm building on the top of shale-blank.
In WEB.XML I added :
<context-param>
<param-name>definitions-config</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
<listener>
<listener-class>
org.apache.tiles.listener.TilesListener
</listener-class>
</listener>
In FACES-CONFIG.xmlI added:
<application>
<view-handler>
org.apache.shale.tiles.TilesViewHandler
</view-handler>
</application>
In WEB-INF\lib I added:
shale-tiles-1.0.4, tiles-core-2.0-r468346-SNAPSHOT
Since I'm reading that shale needs tiles 2, I copied into welcome.jsp (right from tiles 2.0.3 example):
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
and places into tiles.xml reference to tiles-config_2_0.dtd
Got exception:
javax.faces.FacesException: The absolute uri: http://tiles.apache.org/tags-tiles cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176)
org.apache.shale.view.faces.ViewViewHandler.renderView(ViewViewHandler.java:147)
org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176)
org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:267)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
org.apache.jsp.index_jsp._jspService(index_jsp.java:47)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:267)
I tried then to change to struts tiles:
(1)<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles"%>
(2) changing reference in tiles.xml to ...struts/dtds/tiles-config.dtd
(3) and adding struts.jar to WEB-INF\lib.
This time I've got:
43: </p>
44: <div id="level2">
45: <f:subview id="content">
46: <tiles:insert attribute="welc2" flush="false"/>
47: </f:subview>
48: </div>
49:
Stacktrace:
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176)
org.apache.shale.view.faces.ViewViewHandler.renderView(ViewViewHandler.java:147)
org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176)
org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:176)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:267)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:703)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:670)
org.apache.jsp.index_jsp._jspService(index_jsp.java:47)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(ShaleApplicationFilter.java:267
Here is my WELCOME.jsp:
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%//@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles"%>
<f:view>
<%@include file="messages.jspf"%>
<html>
<head>
<title><h:outputText value="#{messages['welcome.title']}"/></title>
<head>
<body>
<p>
<h:outputText value="#{messages['welcome.prompt']}"/>
<h:outputText value="#{welcome.timestamp}">
<f:convertDateTime type="both"/>
</h:outputText>
</p>
<div id="level2">
<f:subview id="content">
<tiles:insert attribute="welc2" flush="false"/>
</f:subview>
</div>
</body>
</html>
</f:view>Hi,
Got exception:
javax.faces.FacesException: The absolute uri: http://tiles.apache.org/tags-tiles cannot be resolved in either web.xml or the jar files deployed with this applicationTo solve above error u need to include tiles-jsp.jar in your project dependency. If you are using maven, you can give dependency in following way.
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.0.5</version>
</dependency> -
Good days , the following exception is happening:
javax.faces.FacesException
at de.mindmatters.faces.lifecycle.RenderResponsePhase.executePhase(RenderResponsePhase.java:53)
at de.mindmatters.faces.lifecycle.AbstractPhase.execute(AbstractPhase.java:37)
at de.mindmatters.faces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:166)
at de.mindmatters.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:226)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:406)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: java.lang.NullPointerException
at org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:168)
at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101)
at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:221)
at de.mindmatters.faces.lifecycle.RenderResponsePhase.executePhase(RenderResponsePhase.java:45)
... 21 more
my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</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 JSF
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.
Poner a false cuando se ponga en produccion.
</description>
</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 JSF
Reference Implementation to validate the XML in your
faces-config.xml resources against the DTD. Default
value is false.
Poner a false cuando se ponga en produccion.
</description>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
<description>
Indica donde queremos guardar el estado de la aplicacion.
Poner a server cuando se ponga en produccion. antes probarlo!
</description>
</context-param>
<context-param>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
<description>
Este parametro le dice a MyFaces si se va a permitir renderizar javascript.
Default: "true"
</description>
</context-param>
<context-param>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
<description>
si es verdadero, el renderizado html estara formateado, permitiendo que se pueda leer
bien. En la fase de desarrollo, estara a true, cuando este en produccion, estara a false.
</description>
</context-param>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<!-- listener de spring-->
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</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>
<!-- Tiles configuration
definition files and a listener need to be defined.
the listener will initialize JspTilesViewHandlerImpl with tiles definitions.
-->
<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>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<filter>
<filter-name>MyFacesExtensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
</filter>
</web-app>
tiles-defs.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<definition name="Base" path="/paginas/plantillaBasica.jsp">
<put name="titulo" value="Base" type="string"/>
<put name="cabecera" value="/cabecera.jsp" type="page"/>
<put name="cuerpo" value="base" type="page"/>
<put name="pie" value="base" type="page"/>
</definition>
<definition name="/busquedaDosCajas.tiles" extends="Base">
<put name="titulo" value="Busqueda con dos cajas" type="string"/>
<put name="cuerpo" value="/paginas/cuerpoDosCajas.jsp" type="page"/>
</definition>
</tiles-definitions>
faces-config.xml
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<!-- =========== FULL CONFIGURATION FILE ================================== -->
<faces-config>
<application>
<view-handler>org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl</view-handler>
</application>
<!-- El mantenimiento del bean proxy se delega al contenedor de spring-->
<application>
<variable-resolver>
org.springframework.web.jsf.DelegatingVariableResolver
</variable-resolver>
</application>
<!-- el unico idioma permitido es el espa�ol.-->
<application>
<locale-config>
<default-locale>es</default-locale>
</locale-config>
</application>
<!--
- navigation rules
-->
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>succesNoJS</from-outcome>
<to-view-id>/paginas/listado.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>error</from-outcome>
<to-view-id>error.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
index.jsp
<%@ page session="false"%>
<%
response.sendRedirect("busquedaDosCajas.jsf");
%>
anybody could help me? i dont know whats happening
regards a lotfirst make sure you are using Tiles stand-alone (in Struts Sandbox)
add the follwoing servlet to your web.xml
<servlet>
<servlet-name>Tiles Servlet</servlet-name>
<servlet-class>org.apache.tiles.servlet.TilesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
add the following context-param to your web.xml
<context-param>
<param-name>tiles-definitions</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
add the following to your faces-config.xml
<view-handler>org.apache.shale.tiles.TilesViewHandler</view-handler>
add the following dependency to your pom.xml
<dependency>
<groupId>org.apache.shale</groupId>
<artifactId>shale-tiles</artifactId>
<version>1.0.3</version>
</dependency>
that should be it.
Khaled -
JSF,Tiles, Sun App Server and NetBeans 5.5
hi all,
here is my environment :
1.Server - Sun Application Server (Running On Suse Linux OS)
2.IDE - NetBeans 5.5
3.Project - JSF with Tiles
here i found topic about tiles and jsf :
http://forum.java.sun.com/thread.jspa?threadID=643536&messageID=3792238 but i think that Tiles is best alternative for JSF Layout Manager (It's my mind).
is there anybody help me how to integrate tiles with jsf ?
here is my example :
1.web.xml :
<servlet>
<servlet-name>Tiles Servlet</servlet-name>
<servlet-class>org.apache.struts.tiles.TilesServlet</servlet-class>
<init-param>
<param-name>definitions-config</param-name>
<param-value>/WEB-INF/tiles-def.xml</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>2. tiles-def.xml :
<tiles-definitions>
<!--****************************************************************-->
<!-- Global Layout -->
<!--****************************************************************-->
<definition name="global.layout" path="/pages/Mylayout/layout.jsp">
<put name="title" value="Magti Billing System" type="string"></put>
<put name="subtitle" value="Magti Billing System" type="string"></put>
<put name="header" value="/pages/Mylayout/header.jsp"></put>
<put name="subheader" value="/pages/Mylayout/sub_header.jsp"></put>
<put name="footer" value="/pages/Mylayout/footer.jsp"></put>
<put name="body" value="/pages/Mylayout/body.jsp"></put>
<put name="left_menu" value="/pages/Mylayout/left_menu.jsp"></put>
</definition>
</tiles-definitions>3.and then i have 5 blank jsp pages : body.jps, footer.jsp, header.jsp, layout.jsp, left_menu.jsp, sub_header.jsp.
4. here is my layout.jsp code :
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:webuijsf="http://www.sun.com/webui/webuijsf"
xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles"
>
<tiles:importAttribute scope="request"></tiles:importAttribute>
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<webuijsf:page binding="#{pages$Mylayout$layout.page1}" id="page1">
<webuijsf:html binding="#{pages$Mylayout$layout.html1}" id="html1">
<webuijsf:head binding="#{pages$Mylayout$layout.head1}" id="head1">
<webuijsf:link binding="#{pages$Mylayout$layout.link1}" id="link1" url="/resources/stylesheet.css"/>
</webuijsf:head>
<webuijsf:body binding="#{pages$Mylayout$layout.body1}" id="body1" style="-rave-layout: grid">
<webuijsf:form binding="#{pages$Mylayout$layout.form1}" id="form1">
<h:panelGrid columns="2" cellspacing="0" cellpadding="0"
border="0" styleClass="maingrid" columnClasses="maingrid">
<f:facet name="header">
<f:subview id="header">
<h:panelGrid columns="1" cellpadding="0" cellspacing="0">
<tiles:insert attribute="header" flush="false" />
<tiles:insert attribute="subheader" flush="false" />
</h:panelGrid>
</f:subview>
</f:facet>
<f:subview id="left_menu">
<tiles:insert attribute="left_menu" flush="false" />
</f:subview>
<f:subview id="body">
<tiles:insert attribute="body" flush="false" />
</f:subview>
<!--
<f:facet name="footer">
<f:subview id="footer">
<tiles:insert attribute="footer" flush="false" />
</f:subview>
</f:facet>
-->
</h:panelGrid>
</webuijsf:form>
</webuijsf:body>
</webuijsf:html>
</webuijsf:page>
</f:view>
</jsp:root>5. and at last i have index.jsp:
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:webuijsf="http://www.sun.com/webui/webuijsf"
xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles"
>
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view>
<webuijsf:page binding="#{pages$main$index.page1}" id="page1">
<webuijsf:html binding="#{pages$main$index.html1}" id="html1">
<webuijsf:head binding="#{pages$main$index.head1}" id="head1">
<webuijsf:link binding="#{pages$main$index.link1}" id="link1" url="/resources/stylesheet.css"/>
</webuijsf:head>
<webuijsf:body binding="#{pages$main$index.body1}" id="body1" style="-rave-layout: grid">
<webuijsf:form binding="#{pages$main$index.form1}" id="form1">
<tiles:insert definition="global.layout" flush="false"/>
</webuijsf:form>
</webuijsf:body>
</webuijsf:html>
</webuijsf:page>
</f:view>
</jsp:root>but i get an error like this :
Can't leverage base class
java.lang.IllegalStateException
at com.sun.faces.taglib.jsf_core.ViewTag.getComponentType(ViewTag.java:259)
at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:219)
at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:458)
at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:643)
at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1070)
at com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:180)
at org.apache.jsp.pages.Mylayout.layout_jsp._jspx_meth_f_view_0(layout_jsp.java:140)
at org.apache.jsp.pages.Mylayout.layout_jsp._jspService(layout_jsp.java:99)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:353)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:412)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:318)Any Ideas Is Usefull. Thanks.
Paata.Hi,
I'm trying to use Tiles with NetBeans 6.0. I used a similar set up as the other writer did, except for the JSP:root part:
<jsp:root version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:webuijsf="http://www.sun.com/webui/webuijsf"
xmlns:tiles="http://jakarta.apache.org/struts/tags-tiles">
It complies and deploys OK, except it renders a blank page. The source code of the page is below. It seems that the "tiles:insertDefinition" was not expanded. Would you share some lights on how you get it to work. By the way I did not use shale-tiles, do I need it?
Thanks in advance.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wairole="http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#" xmlns:waistate="http://www.w3.org/2005/07/aaa">
<head>
<meta content="no-cache" http-equiv="Pragma" />
<meta content="no-cache" http-equiv="Cache-Control" />
<meta content="no-store" http-equiv="Cache-Control" />
<meta content="max-age=0" http-equiv="Cache-Control" />
<meta content="1" http-equiv="Expires" />
<title></title>
<link rel="stylesheet" type="text/css" href="/apogee-web-1.0-SNAPSHOT/theme/com/sun/webui/jsf/suntheme/css/css_master.css" />
<script type="text/javascript">
var djConfig = {
"isDebug": false,
"parseWidgets": false,
"debugAtAllCosts": false
</script>
<script type="text/javascript" src="/apogee-web-1.0-SNAPSHOT/theme/META-INF/dojo/dojo.js"></script>
<script type="text/javascript" src="/apogee-web-1.0-SNAPSHOT/theme/META-INF/json/json.js"></script>
<script type="text/javascript" src="/apogee-web-1.0-SNAPSHOT/theme/META-INF/prototype/prototype.js"></script>
<script type="text/javascript" src="/apogee-web-1.0-SNAPSHOT/theme/META-INF/com_sun_faces_ajax.js"></script>
<script type="text/javascript">
dojo.hostenv.setModulePrefix("webui.suntheme", "/apogee-web-1.0-SNAPSHOT/theme/com/sun/webui/jsf/suntheme/javascript");
dojo.require('webui.suntheme.*');
dojo.require('webui.suntheme.widget.*');
dojo.require('webui.suntheme.widget.jsfx.*');
</script>
<link id="link1" rel="stylesheet" type="text/css" href="/apogee-web-1.0-SNAPSHOT/resources/stylesheet.css" />
</head>
<body id="body1" style="-rave-layout: grid" onload="" onunload="">
<form id="form1" class="form" method="post" action="/apogee-web-1.0-SNAPSHOT/faces/Apogee.jsp" enctype="application/x-www-form-urlencoded">
<tiles:insertDefinition flush="false" name="global.layout" />
<input id="form1_hidden" name="form1_hidden" value="form1_hidden" type="hidden" />
<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="H4sIAAAAAAAAAKVWTWwbRRR+Xmexm4LSOCgEiZRIFESFsk7bCyIUSFInsfBPZZsU2kM6Xk/sDevdYXbWXreiag+ABBcQIIEUBBIcemhP3HoAqh4QSEUiEhdOFReEBBwQEj8HYGZs79qOZZNkZD2vd957M98333vja7+A6lKYOJfaRDWkmcgqa9niJtbZ/JvfPP/hIeeoqQB4BAAiDoUTul3VHNfSNpCOHQ0RYho6YoZtaXmGGE4jC5UxTVaJeaRAMc7YJfz7xo3Prs+tfH63yFM/A2KsdOfBHsOWw7PwlDXEENX4PLEtbDFHO40oM5BZoKiGqYPMNQPXc7bNxCIQ3Vw3Svxz3HNegkug1Gdl/pl2/jouuoa26WwEGXnCMgaVcHusMyo0OGqVVU1QK9x2RSlDojAq8Shuu6LCg6NShvUiqCa3u1lr0S41QC1y2xWlDo5atmkV1A1uj3muiBJD8Z+iwRM//3GpEpcZpraKnEoaETXy/c1bk+e/DYOyDKOmjUrLSGc2TcIBVqHYqdhmySNPPyNT3FWPikSCAAZHRC6vpQC+My4mbem5XC6RKayvJRNn1nPZbEEsPsbg0TYCIQLhrHEcPKCIHKwt5RILhcQpGeTvUSp50bZNjKzbM/Tyd1t//6pA6CyoNWS62CMhBjP9dpBNn85mxB6Sp/I820SAeIFS1EgZDvOubE+//yX6IAyhJIw4xgUsCyRUHxHSY21teYSwQKACSUweyziIidHVQjq1vriQTy4xOBhfIHYZY342hC96KFg0ZevIxJf+HD+/NffXzwqMJCFa4dTrvLJSENFt12K0wSAmCzguYMfzjBpWeT4FUfHT5ZsRyz7A3WuIGshi8qdH/uWDATBQsCVeHe5mL2kxzIs59sNHn/xx5bXHFYG2xV57i9Iv41aLmL567d3pg+/ceaPdLkKEEF87oT7KUjuUJZ7u2SGSkHg9ISfv7eK3WYWdcu1pYS0Grm+v/fjT9MUVf08MIkXDKvG5YGsc9COdQghKQ7a0VS5gTPOi+bzw9acn3966nVZAScEB3USOk0HVNrmjDvcpyRgGk83jMOx4HnPKTeMCKpp4nkuCL3e4rWZsamuCz4RHeKmIBiiaWvjG1eKDD3/1nmiYFKaae9vpWh+9fO7OF/+8pUi3Cd8t8Pj4ldfzv53dflLCr5+AsYcutmQmBfry8DZJiCfQTfomJswUx7czUvrL6R4zUAXh3apACVQguiprd7ze5vVYO3S246jFU5zIr+NdhEhFDSFE3AAtQo76ZgAhTX/SB3TwNLb3ImheD/uELSgcBpv7tGCf9M0g2MI/OH1CAv9u0+/d/1BMJKCsl9vdgZcEDgEvbuIW+Gd9MwB805+IBn9/nJeh7VLeU+IOa5j8LsSYabrjBNuGPvju27skmrf4/iQhq2kIK+KfRouVp3wzgJWmf8/gd9asuM5nTdSwXfbETJkapZ4GEhsuh6m90yWu5rl90iUpH0KX+IvVokv3zQC6pH9nBe0YfUoF/gMrokC8ywsAAA==" />
</form>
<script type="text/javascript">
webui.suntheme.common.body = new webui.suntheme.body('/Apogee.jsp', '/apogee-web-1.0-SNAPSHOT/faces/Apogee.jsp',null,null,'com_sun_webui_util_FocusManager_focusElementId');</script>
</body>
</html> -
Current status of Tiles and JSF integration
Hi. I am new to JSF, and I have been researching Tiles integration with JSF. I've read a lot of posts about difficulties encountered when integrating them, and other posts seem to suggest that it is definitely do-able (some posts say using Shale Tiles is the way to go instead of using Struts tiles.)
I have not found any definitive or straight forward tutorial on integrating Tiles and JSF. Is it a matter of the JSF technology not being fully developed? Will tiles be easily integrated (as it is in Struts) in the future, without jumping through hoops?
Any opinions or advice would be greatly appreciated. I would rather not use JSF w/ JSP includes as an alternative. It seems as though Struts would be a better choice for what I have to do, unless I can integrate JSF and tiles functionality with relative ease.
Thanks.Cold-Gin wrote:
I have not found any definitive or straight forward tutorial on integrating Tiles and JSF. Is it a matter of the JSF technology not being fully developed? Will tiles be easily integrated (as it is in Struts) in the future, without jumping through hoops?I certainly wouldn't say that JSF technology is not fully developed by any stretch. It's certainly possible that there's some sort of impedance mismatch between the two, but Tiles support is hardly the measure of a framework's maturity. :P
Having said that, I really can't say much more than that with regard to Tiles. What I can suggest, though, is JSFTemplating or Facelets. Both are mature products, engineered specifically for use with JSF. Facelets is probably the more popular of the two and is slated for inclusion in JSF 2.0 in some form, while JSFTemplating, which supports the Facelets syntax, is another strong alternative (which, incidentally, is what powers the GlassFish admin GUI).
Hope that helps... -
who can give me some help to use tiles in JSF(myfaces) with shale?
there's a error when i do this, see following:
pplicationDispatcher[jsftest] Servlet.service() for servlet Faces Servlet threw exception
java.lang.IllegalStateException: Cannot forward after response has been committed
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:324)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
at org.apache.shale.clay.faces.ClayViewHandler.renderView(ClayViewHandler.java:442)
at org.apache.shale.view.faces.ViewViewHandler.renderView(ViewViewHandler.java:151)
at org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:175)
at org.apache.shale.tiles.TilesViewHandler.renderView(TilesViewHandler.java:175)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:610)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:604)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:122)
at org.apache.tiles.TilesUtil.doInclude(TilesUtil.java:136)
at org.apache.tiles.taglib.InsertTag.doInclude(InsertTag.java:642)
at org.apache.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:772)
at org.apache.tiles.taglib.InsertTag.doEndTag(InsertTag.java:382)
at org.apache.jsp.jsp.tiles.layout_jsp._jspx_meth_tiles_insert_2(layout_jsp.java:137)
at org.apache.jsp.jsp.tiles.layout_jsp._jspService(layout_jsp.java:71)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:581)
at org.apache.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:131)
at org.apache.tiles.TilesUtil.doInclude(TilesUtil.java:136)
at org.apache.tiles.taglib.InsertTag.doInclude(InsertTag.java:642)
at org.apache.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:772)
at org.apache.tiles.taglib.InsertTag.doEndTag(InsertTag.java:382)
at org.apache.jsp.jsp.tiles.login_jsp._jspx_meth_tiles_insert_0(login_jsp.java:80)
at org.apache.jsp.jsp.tiles.login_jsp._jspService(login_jsp.java:54)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at com.xdf.common.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:101)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)Same host is fine. The hardware requirements will go higher though. As long as your host can handle both mid tier 903 and Infrastructure 902 in one box, there is no problem them to coexist in one host.
Regards
Pavna Jain
Oracle9iAS Product Manager -
Ejb3 app functions only when both .jsf and .jsp is present
Hi All,
I have the following problem: when I try to remove either of booking.jsp and booking.jsf (having same contents) from the directory tree of app.war (following), I get the message HTTP status 404 The requested resource (/s_ejb3_jb421_tobbfele/pages/booking.jsp) is not available.
Thank you in advance: Balazs Bamer
JBoss 4.2.1 output:
16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.DETECT_JAVASCRIPT' found, using default value false
16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.AUTO_SCROLL' found, using default value false
16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ADD_RESOURCE_CLASS' found, using default value org.apache.myfaces.renderkit.html.util.DefaultAddResource
16:23:21,101 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ADD_RESOURCE_CLASS' found, using default value org.apache.myfaces.renderkit.html.util.DefaultAddResource
16:23:21,121 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.CHECK_EXTENSIONS_FILTER' found, using default value true
app.war (inside s_ejb3_jb421_tobbfele.ear) contents, with only the booking.jsf:
META-INF/
META-INF/MANIFEST.MF
WEB-INF/
WEB-INF/web.xml
WEB-INF/lib/
WEB-INF/lib/com-sun-rave-designtime.jar
WEB-INF/lib/commons-beanutils.jar
WEB-INF/lib/commons-chain.jar
WEB-INF/lib/commons-codec.jar
WEB-INF/lib/commons-collections.jar
WEB-INF/lib/commons-digester.jar
WEB-INF/lib/commons-el.jar
WEB-INF/lib/commons-fileupload.jar
WEB-INF/lib/commons-lang.jar
WEB-INF/lib/commons-logging.jar
WEB-INF/lib/commons-validator.jar
WEB-INF/lib/jakarta-oro.jar
WEB-INF/lib/jsfcl-dt.jar
WEB-INF/lib/jsfcl.jar
WEB-INF/lib/jstl-api.jar
WEB-INF/lib/jstl-impl.jar
WEB-INF/lib/openide.jar
WEB-INF/lib/propertyeditors.jar
WEB-INF/lib/shale-clay.jar
WEB-INF/lib/shale-core.jar
WEB-INF/lib/shale-remoting.jar
WEB-INF/lib/shale-tiger.jar
WEB-INF/lib/shale-tiles.jar
WEB-INF/lib/shale-view-1.0.4.jar
WEB-INF/lib/tiles-core.jar
WEB-INF/lib/tomahawk-1.1.2-SNAPSHOT.jar
WEB-INF/classes/
WEB-INF/classes/com/
WEB-INF/classes/com/loxon/
WEB-INF/classes/com/loxon/shaleproba/
WEB-INF/classes/com/loxon/shaleproba/FlightServlet.class
booking_messages.properties
booking_messages_en.properties
booking_messages_es.properties
booking_messages_fr.properties
images/
pages/
theme/
index.html
pages/booking.jsf
theme/style.css
WEB-INF/faces-config.xml
index.html:
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=pages/booking.jsf">
</head>
</html>faces-config.xml:
<?xml version="1.0"?>
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<managed-bean>
<managed-bean-name>flightServlet</managed-bean-name>
<managed-bean-class>com.loxon.shaleproba.FlightServlet</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>web.xml:
<?xml version="1.0"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<description>debug web.xml</description>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
<description>
State saving method: "client" or "server" (= default)
See JSF Specification 2.5.2
</description>
</context-param>
<context-param>
<param-name>javax.faces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
<description>
This parameter tells MyFaces if javascript code should be allowed in the
</description>
</context-param>
<context-param>
<param-name>javax.faces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>javax.faces.PRETTY_HTML</param-name>
<param-value>true</param-value>
<description>
If true, rendered HTML code will be formatted, so that it is "human readable".
i.e. additional line separators and whitespace will be written, that do not
influence the HTML code.
Default: "true"
</description>
</context-param>
<context-param>
<param-name>javax.faces.AUTO_SCROLL</param-name>
<param-value>true</param-value>
<description>
If true, a javascript function will be rendered that is able to restore the
former vertical scroll on every request. Convenient feature if you have pages
with long lists and you do not want the browser page to always jump to the top
if you trigger a link or button action that stays on the same page.
Default: "false"
</description>
</context-param>
<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
<init-param>
<param-name>maxFileSize</param-name>
<param-value>20m</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>
</filter>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>shale</filter-name>
<filter-class>
org.apache.shale.faces.ShaleApplicationFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>shale</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>booking.jsf:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://struts.apache.org/shale/core" prefix="s" %>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<html>
<head>
<title>Metro Systems </title>
<link href="../theme/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
<f:loadBundle basename="booking_messages" var="booking_messages"/>
<f:view>
<h3> <h:outputText value="#{booking_messages['welcome']}"/> </h3>
<h:form onsubmit="return validateForm(this);">
<table align="center" cellpadding="5" cellspacing="5">
<tr>
<td>Email</td>
<td><h:inputText id="email" value="#{flightServlet.flight.email}">
<s:commonsValidator type="required"
arg="Email"
server="true"
client="true"/>
<s:commonsValidator type="email"
arg="#{flightServlet.flight.email}"
server="true"
client="true"/>
</h:inputText>
</td>
</tr>
<tr>
<td><h:outputText id="departure" value="#{booking_messages['date']}"/></td>
<td>
<t:inputCalendar monthYearRowClass="yearMonthHeader" weekRowClass="weekHeader"
currentDayCellClass="currentDayCell" value="#{flightServlet.flight.departure}" renderAsPopup="true"
popupTodayString="#{booking_messages['popup_today_string']}" popupWeekString="#{booking_messages['popup_week_string']}">
<s:commonsValidator type="required"
arg="Departure date"
server="true"
client="true"/>
</t:inputCalendar>
</td>
</tr>
<tr>
<td><h:outputText value="#{booking_messages['city']}"/> </td>
<td> <h:selectOneMenu value="#{flightServlet.flight.city}" required="true">
<f:selectItem itemLabel="Los Angeles" itemValue="Los Angeles"/>
<f:selectItem itemLabel="Madrid" itemValue="Madrid"/>
<f:selectItem itemLabel="Mexico City" itemValue="Mexico City"/>
<f:selectItem itemLabel="New York" itemValue="New York"/>
<f:selectItem itemLabel="Paris" itemValue="Paris"/>
</h:selectOneMenu></td>
</tr>
</table>
<h:message for="email" styleClass="errors"/>
<h:message for="departure" styleClass="errors"/>
<s:validatorScript functionName="validateForm"/>
<h:commandButton type="submit" value="#{booking_messages['reserve']}" action="#{flightServlet.reserve}"/>
<h:messages/>
</h:form>
</f:view>
</div>
</body>
</html>ear application.xml:
<application>
<display-name>JSF Shale EJB3 JBoss 4.2.1</display-name>
<module>
<web>
<web-uri>app.war</web-uri>
<context-root>/s_ejb3_jb421_tobbfele</context-root>
</web>
</module>
<module>
<ejb>app.jar</ejb>
</module>
</application>ear jboss-ap.xml:
<jboss-app>
<loader-repository>
s_ejb3_jb421_tobbfele:archive=s_ejb3_jb421_tobbfele.ear
</loader-repository>
</jboss-app><servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>tells JSF, that it will get accessed via urls which end in jsf. So it's just a logical name
e.g. index.jsf
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jsp</param-value>
</context-param>Tells JSF that the content filename will end in .jsp
Default is jsp anyway, so this param is optional.
Edit:
http://www.exadel.com/tutorial/jsf/jsftutorial-kickstart.html
Chapter "Creating the index.jsp File" might help you with the question about processing "jsp only" pages
Edited by: dube on Oct 26, 2007 2:11 AM -
JSF 1.2 and Tiles integration
I have a web application using JSF 1.1 and Tiles that I am trying to upgrade to run using JSF 1.2.
It is working as far as working out that it should use the tile, but then it all seems to fall over when trying to render.
Does anyone know if it is possible to use Tiles with JSF 1.2?
StevenHi,
I took the Shales TileViewHandler and replaced the renderView method with the one below. This is a copy of the method from the Sun RI except that it passes the tile (ComponentDefinition) along to the subsequent methods.
Then when it gets down to executePageToBuildView the requestURI is obtained from the tile (tile.getPath()) rather than from the UIViewRoot (viewToExecute.getViewId()).
public void renderView(FacesContext facesContext, UIViewRoot viewToRender)
throws IOException, FacesException {
String viewId = viewToRender.getViewId();
String tileName = getTileName(viewId);
ComponentDefinition tile = getTile(tileName);
if (log.isDebugEnabled()) {
String message = null;
try {
message = bundle.getString("tiles.renderingView");
} catch (MissingResourceException e) {
message = "Rendering view {0}, looking for tile {1}";
synchronized(format) {
format.applyPattern(message);
message = format.format(new Object[] { viewId, tileName });
log.debug(message);
if (tile != null) {
if (log.isDebugEnabled()) {
String message = null;
try {
message = bundle.getString("tiles.dispatchingToTile");
} catch (MissingResourceException e) {
message = "Dispatching to tile {0}";
synchronized(format) {
format.applyPattern(message);
message = format.format(new Object[] { tileName });
log.debug(message);
dispatchToTile(facesContext, viewToRender, tile);
else {
if (log.isDebugEnabled()) {
String message = null;
try {
message = bundle.getString("tiles.dispatchingToViewHandler");
} catch (MissingResourceException e) {
message = "Dispatching {0} to the default view handler";
synchronized(format) {
format.applyPattern(message);
message = format.format(new Object[] { viewId });
log.debug(message);
defaultViewHandler.renderView(facesContext, viewToRender);
private void dispatchToTile(FacesContext facesContext, UIViewRoot viewToRender, ComponentDefinition tile) throws java.io.IOException
ExternalContext externalContext = facesContext.getExternalContext();
Object request = externalContext.getRequest();
Object context = externalContext.getContext();
TilesContext tilesContext = TilesContextFactory.getInstance(context, request);
ComponentContext tileContext = ComponentContext.getContext(tilesContext);
if (tileContext == null) {
tileContext = new ComponentContext(tile.getAttributes());
ComponentContext.setContext(tileContext, tilesContext);
else
tileContext.addMissing(tile.getAttributes());
renderTile(facesContext, viewToRender, tile);
// dispatch to the tile's layout
//externalContext.dispatch(tile.getPath());
private void renderTile(FacesContext context, UIViewRoot viewToRender, ComponentDefinition tile) throws IOException, FacesException
// suppress rendering if "rendered" property on the component is
// false
if (!viewToRender.isRendered()) {
return;
ExternalContext extContext = context.getExternalContext();
ServletRequest request = (ServletRequest) extContext.getRequest();
ServletResponse response = (ServletResponse) extContext.getResponse();
try {
if (executePageToBuildView(context, viewToRender, tile)) {
response.flushBuffer();
//ApplicationAssociate.getInstance(extContext).responseRendered();
return;
} catch (IOException e) {
throw new FacesException(e);
// set up the ResponseWriter
RenderKitFactory renderFactory = (RenderKitFactory)
FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
RenderKit renderKit =
renderFactory.getRenderKit(context, viewToRender.getRenderKitId());
ResponseWriter oldWriter = context.getResponseWriter();
initBuffSize(context);
WriteBehindStringWriter strWriter =
new WriteBehindStringWriter(context, bufSize);
ResponseWriter newWriter;
if (null != oldWriter) {
newWriter = oldWriter.cloneWithWriter(strWriter);
} else {
newWriter = renderKit.createResponseWriter(strWriter, null,
request.getCharacterEncoding());
context.setResponseWriter(newWriter);
newWriter.startDocument();
doRenderView(context, viewToRender);
newWriter.endDocument();
// replace markers in the body content and write it to response.
ResponseWriter responseWriter;
if (null != oldWriter) {
responseWriter = oldWriter.cloneWithWriter(response.getWriter());
} else {
responseWriter = newWriter.cloneWithWriter(response.getWriter());
context.setResponseWriter(responseWriter);
strWriter.flushToWriter(responseWriter);
if (null != oldWriter) {
context.setResponseWriter(oldWriter);
// write any AFTER_VIEW_CONTENT to the response
writeAfterViewContent(extContext, response);
private boolean executePageToBuildView(FacesContext context, UIViewRoot viewToExecute, ComponentDefinition tile)
throws IOException {
if (null == context) {
String message = MessageUtils.getExceptionMessageString
(MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "context");
throw new NullPointerException(message);
if (null == viewToExecute) {
String message = MessageUtils.getExceptionMessageString
(MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "viewToExecute");
throw new NullPointerException(message);
String mapping = Util.getFacesMapping(context);
String requestURI =
updateRequestURI(viewToExecute.getViewId(), mapping);
String requestURI =
updateRequestURI(tile.getPath(), mapping);
if (mapping.equals(requestURI)) {
// The request was to the FacesServlet only - no path info
// on some containers this causes a recursion in the
// RequestDispatcher and the request appears to hang.
// If this is detected, return status 404
HttpServletResponse response = (HttpServletResponse)
context.getExternalContext().getResponse();
response.sendError(HttpServletResponse.SC_NOT_FOUND);
return true;
ExternalContext extContext = context.getExternalContext();
// update the JSTL locale attribute in request scope so that JSTL
// picks up the locale from viewRoot. This attribute must be updated
// before the JSTL setBundle tag is called because that is when the
// new LocalizationContext object is created based on the locale.
// PENDING: this only works for servlet based requests
if (extContext.getRequest()
instanceof ServletRequest) {
Config.set((ServletRequest)
extContext.getRequest(),
Config.FMT_LOCALE, context.getViewRoot().getLocale());
// save the original response
Object originalResponse = extContext.getResponse();
// replace the response with our wrapper
ViewHandlerResponseWrapper wrapped =
new ViewHandlerResponseWrapper(
(HttpServletResponse)extContext.getResponse());
extContext.setResponse(wrapped);
// build the view by executing the page
extContext.dispatch(requestURI);
// replace the original response
extContext.setResponse(originalResponse);
// Follow the JSTL 1.2 spec, section 7.4,
// on handling status codes on a forward
if (wrapped.getStatus() < 200 || wrapped.getStatus() > 299) {
// flush the contents of the wrapper to the response
// this is necessary as the user may be using a custom
// error page - this content should be propagated
wrapped.flushContentToWrappedResponse();
return true;
// Put the AFTER_VIEW_CONTENT into request scope
// temporarily
if (wrapped.isBytes()) {
extContext.getRequestMap().put(AFTER_VIEW_CONTENT,
wrapped.getBytes());
} else if (wrapped.isChars()) {
extContext.getRequestMap().put(AFTER_VIEW_CONTENT,
wrapped.getChars());
return false;
}You will also find you need to copy a few other methods from the Sun RI.
There were a couple of calls to ApplicationAssociate.responseRendered() which I just commented out as well (because they are not visible). They stop people changing the StateManager or ViewHandler after responses have been rendered. Probably not a problem since I will have replaced the ViewHandler anyway.
Steven -
Struts Tiles support for Creator
Has anyone managed to get Creator to work with pages controlled by Tiles?
Is it possible?Yes, I have tiles working with Creator. I'm using Shale standalone tiles. There's some work to do -- you have to modify the ViewHandler if you're using JSF 1.2, but it does work.
W. -
500 error while accessing a jsp using tiles tags
Hi all,
when im trying to access a jsp which makes use of tiles tags, im getting the following error.
status 500:
org.apache.jasper.JasperException: The absolute uri: http://struts.apache.org/tags-tiles cannot be resolved in either web.xml or the jar files deployed with this application
what might be the problem?
Thanks in advance.asp,
1. this is a java forum, and that's a jsp/struts question... you'll do better on the jsp forum.... or maybe a struts forum.
2. it can't find http://struts.apache.org/tags-tiles ... but you knew that already didn't you... and where in the wide world might that uri be? maybe in struts generated xml? maybe in the schema declatation?
keith. -
Can't access recent Emails from mail tile in window 8.1
Can't access recent Emails from mail tile in window 8.1. Everything working fine until yesterday. I can get my Emails by going to google Chrome and accessing my gmail but I like just hitting the mail tile in 8.1. Also is the start
of something bad onmy computer?Hi,
Could you please explain a bit for the " mail tile " mentioned here?
If you mean to access e-mail with the Mail APP, and have issues when using it, we may first take a try with the
Apps troubleshooter.
More information regarding mail APP troubleshooting, please check the below TechNet Wiki:
Troubleshooting the Modern Mail App on Windows 8
Troubleshoot problems with an app
If any further help needed, please feel free to update here.
Best regards
Michael Shao
TechNet Community Support -
Problem defining relative path ofr images in struct tiles
hi
I have a jsp pages in which i am setting the layout using tiles . To display an image
i am using < img src= "./../images/abc.gif" />
this doesnt seem to work.
but if i give absolute path like src="C:\myDoc|....\abc.gif" it works.
As i have to deploy it so i cant give absolute path.
One solution i found is to use request.getContextPath()
<img src="<%=request.getContextPath()%>/tutorial/images/abc.gif" works.
is there any way we can give relative path like ?
< img src= "./../images/abc.gif" />Hi , I have found the solution.
<c:url value='/javascript/menuscript.js'/>"{code} can be used to avoide the absoulte path . The c:url tag takes default value as Webcontent . so you need to give only path after the webContent
Maybe you are looking for
-
Is there a way of reducing the print borders in Numbers for ipad?
I've recently purchased Numbers for my Ipad 2 and now need to print off my spreadsheets. However when I go to preview the sheets there seems to be a massive print border around the data? I've looked all over the app for a way to reduce it but can't f
-
Ipod touch 4 and iTunes are not Friends
I have a gen 4 iPod touch (64 gig), and for some reason, all of a sudden and without warning it will not back up or properly sync to iTunes. I can't determine if the problem is the iPod or the computer. I have a Gateway laptop running Windows 7 as t
-
Error 7 (windows error 127) Help?
Hi Everyone, After downloading a the latest version of itunes, I got the below error messages. "The Procedure entry point JSPropertyNameArrayRelease could not be located in the dynamic link library WebKit.dll" "Itunes was not installed correctly Plea
-
Exchange program for older Apple TV units
My wife and I are proud owners of multiple Apple TV units for several years now and have always highly recommended them to friends and family as a means for watching content on existing TV sets. To our disappointment-especially with my kids-we recent
-
Error when unning the report in bex.
Hi All I have data in multi provider , based on multi provider there is some reports is there, when i run one report it run sucess fully but while running the another report it gives below warning warning Hierarchy 0RGEH in version 000 was not found