JSF中MyFaces1.2参考实现(包括facelets和Tomahaw)的web.xml怎么写?

CarlKing 2008-12-10
myfaces-api-1.2.5.jar
myfaces-impl-1.2.5.jar
myfaces-shared-impl-3.0.5.jar

tomahawk12-1.1.7.jar

jsf-facelets.jar(1.14的)

IDE:Eclipse3.3
     JDK6.0

本人搞两周了,都不能实现Myfaces的tomahawk在facelets生效,哪位DX可以实现的 不用RI.希望把 web.xml里面的内容贴出来一下 能指出myfaces和RI不同配置出最好了 希望各位指点一下.崩溃了。
terryzhou 2008-12-11
<?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">
<web-app>
	<description>power</description>

	<!-- Commons Chain Configuration Resources
	<context-param>
		<param-name>
			org.apache.commons.chain.CONFIG_WEB_RESOURCE
		</param-name>
		<param-value>/WEB-INF/chain-config.xml</param-value>
	</context-param> -->

	<!-- Dialog Configuration Resources (comma-separated list) 
	<context-param>
		<param-name>org.apache.shale.dialog.CONFIGURATION</param-name>
		<param-value>/WEB-INF/dialog-config.xml</param-value>
	</context-param>

	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
			/WEB-INF/classes/config/application-context.xml
		</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>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>facelets.LIBRARIES</param-name>
		<param-value>/WEB-INF/facelets/taglib.xml</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>
			org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION
		</param-name>
		<param-value>20</param-value>
	</context-param>

	<context-param>
		<param-name>
			org.apache.myfaces.SERIALIZE_STATE_IN_SESSION
		</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>
			org.apache.myfaces.COMPRESS_STATE_IN_SESSION
		</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>
			org.apache.myfaces.redirectTracker.POLICY
		</param-name>
		<param-value>
			org.apache.myfaces.custom.redirectTracker.policy.NoopRedirectTrackPolicy
		</param-value>
	</context-param>

	<context-param>
		<param-name>
			org.apache.myfaces.redirectTracker.MAX_REDIRECTS
		</param-name>
		<param-value>20</param-value>
	</context-param>

	<context-param>
		<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
		<param-value>false</param-value>
	</context-param>

	<context-param>
		<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
		<param-value>false</param-value>
	</context-param>

	<context-param>
		<param-name>org.apache.myfaces.ERROR_HANDLING</param-name>
		<param-value>false</param-value>
	</context-param>

	<context-param>
		<param-name>org.apache.myfaces.ERROR_HANDLER</param-name>
		<param-value>
			com.jstrd.power.view.global.ErrorHandle
		</param-value>
	</context-param>

	<context-param>
		<param-name>org.apache.myfaces.VALIDATE</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
		<param-value>
			org.apache.myfaces.renderkit.html.util.DefaultAddResource
		</param-value>
	</context-param>

	<context-param>
		<param-name>
			org.apache.myfaces.CHECK_EXTENSIONS_FILTER
		</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>
			org.apache.myfaces.RESOURCE_VIRTUAL_PATH
		</param-name>
		<param-value>/faces/extensionResource</param-value>
	</context-param>

	<context-param>
		<param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
		<param-value>false</param-value>
	</context-param>

	<context-param>
		<param-name>
			javax.faces.PARTIAL_STATE_SAVING_DISPATCH_EVERY_TIME
		</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>org.richfaces.SKIN</param-name>
		<param-value>classic</param-value>
	</context-param>

	<context-param>
		<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>org.ajax4jsf.COMPRESS_STYLE</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>org.ajax4jsf.xmlparser.ORDER</param-name>
		<param-value>NEKO</param-value>
	</context-param>

	<context-param>
		<param-name>org.richfaces.LoadScriptStrategy</param-name>
		<param-value>DEFAULT</param-value>
	</context-param>

	<context-param>
		<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
		<param-value>com.sun.facelets.FaceletViewHandler</param-value>
	</context-param>

	<!-- Shale Application Controller Filter 
	<filter>
		<filter-name>shale</filter-name>
		<filter-class>
			org.apache.shale.application.faces.ShaleApplicationFilter
		</filter-class>
	</filter>-->

	<!-- Shale Application Controller Filter Mapping 
	<filter-mapping>
		<filter-name>shale</filter-name>
		<url-pattern>/*</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>-->

	<!-- Commons Chain Configuration Listener 
	<listener>
		<listener-class>
			org.apache.commons.chain.web.ChainListener
		</listener-class>
	</listener>
-->
	<filter>
		<filter-name>extensionsFilter</filter-name>
		<filter-class>
			org.apache.myfaces.webapp.filter.ExtensionsFilter
		</filter-class>
		<init-param>
			<param-name>uploadMaxFileSize</param-name>
			<param-value>100m</param-value>
		</init-param>
		<init-param>
			<param-name>uploadThresholdSize</param-name>
			<param-value>100k</param-value>
		</init-param>
	</filter>

	<filter>
		<display-name>RichFaces Filter</display-name>
		<filter-name>richfaces</filter-name>
		<filter-class>org.ajax4jsf.Filter</filter-class>
	</filter>

	<filter-mapping>
		<filter-name>extensionsFilter</filter-name>
		<url-pattern>*.jsf</url-pattern>
	</filter-mapping>

	<filter-mapping>
		<filter-name>richfaces</filter-name>
		<servlet-name>Faces Servlet</servlet-name>
		<dispatcher>FORWARD</dispatcher>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>INCLUDE</dispatcher>
	</filter-mapping>

	<!-- 
	<listener>
		<listener-class>
			org.springframework.web.util.Log4jConfigListener
		</listener-class>
	</listener>

	<listener>
		<listener-class>
			org.springframework.web.context.ContextLoaderListener
		</listener-class>
	</listener>
	 -->
	 
	<listener>
		<listener-class>
			org.apache.myfaces.webapp.StartupServletContextListener
		</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>nitrox-debugger-tomcat5</servlet-name>
		<servlet-class>
			org.apache.jasper.servlet.JspServlet
		</servlet-class>
		<init-param>
			<param-name>suppressSmap</param-name>
			<param-value>true</param-value>
		</init-param>
		<load-on-startup>3</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.jsp</welcome-file>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>

	<error-page>
		<error-code>500</error-code>
		<location>/error.jsf</location>
	</error-page>
</web-app>


<!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>
		<locale-config>
			<default-locale>en</default-locale>
		</locale-config>
		<!-- <variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>-->
		<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
	</application>
</faces-config>


web.xml+faces-config.xml
里面有SHALE,SPRING,richfaces的config,懒得去了
CarlKing 2008-12-11
  仁兄,这么多我眼睛直接花掉了
只要个myfaces参考实现+tomahawk 就行了
  对比一下和RI的有什么区别
terryzhou 2008-12-12
拜托有点自学能力好吧。。这很难么?
Arron.li 2008-12-12
我也是差不过搞了两周,我做的是richface+ facelets +tomahawk整合,
昨天tree2 components竟然出来了,今天又出了问题, 我是用maven管理的
现在还没有什么好的思路
下面是我的jar
tomahawk-1.1.8
myfaces-api-1.1.5
myfaces-impl-1.1.5
richfaces-api-3.1.6GA
richfaces-impl-3.16GA
jsf-facelets1.1.11
我在myfaces官方网站上看到tomahawk1.1.6以后的release版本可以自动支持facelets,所以你不用在导入tomahawk-facelets-tablib.jar的包,虽然我在仍然没有完全成功,不过你可以下面的网站
http://blog.sina.com.cn/s/blog_4d1cc4c90100bprr.html
http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk
CarlKing 2008-12-14

JSF中MyFaces1.2和RI的web.xml配置是不是一样的?
还有Tomahawk只可以在MyFaces1.2参考实现下使用么、可以不可以在RI上使用?
  我都崩溃完了。
terryzhou 2008-12-15
1.YES
2.YES
3.建议你把启动出错的信息放到网上搜下
Global site tag (gtag.js) - Google Analytics