- 浏览: 1379677 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (328)
- JSF (27)
- 生活 (12)
- Ajax (26)
- Maven (6)
- CSS (1)
- Shale (3)
- SiteMesh (1)
- Ext (15)
- JMX (2)
- Windows技巧 (7)
- 工作感悟 (18)
- SVN (2)
- SVG (0)
- GoogleGear (0)
- RAP (2)
- SOA与WebService (3)
- 笔记本技术研究 (1)
- Microsoft (2)
- 英语学习 (3)
- PHP (7)
- web 2.0 (6)
- 语义Web (1)
- IT史话 (3)
- iText (3)
- JVM (1)
- PropertiesEditor (1)
- J2SE (33)
- Spring (2)
- Java Batch (1)
- log (2)
- Struts2 (2)
- DWR (0)
- JAAS (3)
- EJB3 (4)
- Flex (8)
- JFreeChart (1)
- WAS (0)
- 数据库 (2)
- 摄影 (0)
- SQL (1)
- Google App Engine (1)
- linux (5)
- Eclipse plugin (10)
- Testing (0)
- Portal (0)
- 移动互联网 (0)
- SWTBot (1)
最新评论
-
江奇缘:
不错!!!!!!
web.xml里<filter-mapping>中的<dispatcher>作用 -
yy8093:
commonj 第三步,那个调用的方法要在哪里调?servle ...
JAVA中多种计时器的比较与分析 -
di1984HIT:
学习了,不错~
web.xml里<filter-mapping>中的<dispatcher>作用 -
penkee:
com.lowagie.text.DocumentExcept ...
iText中输出 中文 -
氵壞男亼乀:
我想请问下 你哪个html里面引入的几个js文件没看懂!你 ...
DWR入门教程之HelloWorld
在集成sitemesh,myfaces,richfaces 时,会遇到各种问题,如:
1.Could not invoke the service() method on servlet Faces Servlet. Exception thrown : javax.servlet.ServletException: org.apache.myfaces.webapp.webxml.WebXml.init must be called before!
2.java.lang.NoClassDefFoundError: Error while defining class: org.apache.myfaces.custom.autoupdatedatatable.AutoUpdateDataTable
This error indicates that the class: org.apache.myfaces.component.html.ext.HtmlDataTable
could not be located while defining the class: org.apache.myfaces.custom.autoupdatedatatable.AutoUpdateDataTable
This is often caused by having the class at a higher point in the classloader hierarchy
3.Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
诸如此类的问题,不一而足,我用的环境是Websphere Application Server 6.1,里面还面临着替换ibm的jsf ri问题,下面逐一解决:
1.在Websphere Application Server 6.1中去掉自带的RI,安装MyFaces RI
主要是改变应用的类加载策略,都改成PARANT_LAST,注意无论是EAR包的加载策略还是WAR的加载策略都需要改变,下面是一个更加详细的文档:
Unlike Websphere 6.0, in Websphere 6.1 the JSF Sun RI is bundled together with several other WAS libraries in com.ibm.ws.webcontainer_2.0.0.jar, so removing the webspheres JSF API jars is not an option. The procedure below describes how to use MyFaces, TOMAHAWK (and even Tiles) on Websphere 6.1 by altering the module classloader policy to load classes using the application class loader first (thereby loading the MyFaces jars before the Sun RI jars). This procedure has been tested with MyFaces 1.1.3, TOMAHAWK 1.1.3, and Websphere 6.1.0.2.
1. Copy the MyFaces JSF jars and dependencies to WebApp lib (follow step 1 of the Websphere 6.0 Installation Guide without removing IBM jars below).
Make sure you do NOT copy commons-logging-1.0.4 jar (conflicts with the commons-logging jar already provided by Websphere) and also jsp-2.0.jar (which will cause a "com.ibm.ws.jsp.taglib.TldParser logParseErrorMessage: The JSP container failed to load the TagExtraInfo class" exception with JSF applications that use tiles).
2. Deploy the web application on WAS.
3. Alter the module classloader policy to application first.
Note that there are several ways to set the classloader policy in websphere (at the server, application, and module level). You need to set it at the module level as follows: Click on Enterprise Applications > Your application > Manage Modules > Your war file > Change Class loader order to "Classes loaded with application class loader first"
4. Start your application.
2,更换必要的jar包:
我使用的jar包如下:
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-el-1.0.jar
commons-logging-1.0.4.jar
el-api.jar
el-ri.jar
jhighlight-1.0.jar
jstl-1.0.jar
myfaces-all-2005-10-25.jar
myfaces-api-1.1.5.jar
myfaces-impl-1.1.5.jar
nekohtml-0.9.5.jar
richfaces-api-3.1.0.jar
richfaces-impl-3.1.0.jar
richfaces-ui-3.1.0.jar
sandbox.jar
sitemesh-2.3.jar
tomahawk.jar
xercesImpl-2.4.0.jar
其中sitemesh这个包需要重新build,具体的方法如下(可以参照reference1):
你需要重新下载这个文件:SMViewHandler.zip ,也可以从本文的附件中下载,然后:
+You can drop the unzipped folder in sitemesh source folder and do a rebuild.(rebuild的时候需要添加myfaces的jar包到lib目录下,还需要添加log包,也可以直接使用附件中带的jar)
+Add the following to your web.xml:
- <filter>
- <filter-name>sitemeshfilter-name>
- <filter-class>net.climbingrose.sitemesh.filter.SMInitFilterfilter-class>
- filter>
- <filter-mapping>
- <filter-name>sitemeshfilter-name>
- <url-pattern>/*url-pattern>
- filter-mapping>
+In your faces-config.xml:
- <view-handler>
- net.climbingrose.sitemesh.jsf.SMViewHandlerImp
- view-handler>
3.配置web.xml
我的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">
- <description>smrdescription>
- <context-param>
- <param-name>javax.faces.CONFIG_FILESparam-name>
- <param-value>/WEB-INF/examples-config.xmlparam-value>
- context-param>
- <context-param>
- <param-name>javax.faces.STATE_SAVING_METHODparam-name>
- <param-value>clientparam-value>
- context-param>
- <context-param>
- <param-name>com.sun.faces.validateXmlparam-name>
- <param-value>trueparam-value>
- context-param>
- <context-param>
- <param-name>com.sun.faces.verifyObjectsparam-name>
- <param-value>trueparam-value>
- context-param>
- <context-param>
- <param-name>org.ajax4jsf.COMPRESS_SCRIPTparam-name>
- <param-value>falseparam-value>
- context-param>
- <context-param>
- <param-name>org.ajax4jsf.xmlparser.ORDERparam-name>
- <param-value>NEKOparam-value>
- context-param>
- <filter>
- <filter-name>ajax4jsffilter-name>
- <filter-class>org.ajax4jsf.Filterfilter-class>
- filter>
- <filter>
- <filter-name>sitemeshfilter-name>
- <filter-class>net.climbingrose.sitemesh.filter.SMInitFilterfilter-class>
- filter>
- <filter-mapping>
- <filter-name>ajax4jsffilter-name>
- <servlet-name>Faces Servletservlet-name>
- <dispatcher>FORWARDdispatcher>
- <dispatcher>REQUESTdispatcher>
- <dispatcher>INCLUDEdispatcher>
- <dispatcher>ERRORdispatcher>
- filter-mapping>
- <filter-mapping>
- <filter-name>sitemeshfilter-name>
- <url-pattern>/*url-pattern>
- filter-mapping>
- <listener>
- <listener-class>org.apache.myfaces.webapp.StartupServletContextListenerlistener-class>
- listener>
- <!---->
- <servlet>
- <servlet-name>Faces Servletservlet-name>
- <servlet-class>javax.faces.webapp.FacesServletservlet-class>
- <load-on-startup>1load-on-startup>
- servlet>
- <!---->
- <!---->
- <servlet-mapping>
- <servlet-name>Faces Servletservlet-name>
- <url-pattern>/faces/*url-pattern>
- servlet-mapping>
- <!---->
- <servlet-mapping>
- <servlet-name>Faces Servletservlet-name>
- <url-pattern>*.jsfurl-pattern>
- servlet-mapping>
- <!---->
- <welcome-file-list>
- <welcome-file>index.jspwelcome-file>
- <welcome-file>index.htmlwelcome-file>
- welcome-file-list>
- web-app>
具体的原因,我就不具体说了。
下面是我的JSF 配置文件,可以参考:
- <!---->xml version="1.0"?>
- <!---->
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_0.dtd" >
- <faces-config>
- <application>
- <view-handler>
- net.climbingrose.sitemesh.jsf.SMViewHandlerImp
- view-handler>
- application>
- <!---->
- <managed-bean>
- <managed-bean-name>helloWorldBackingmanaged-bean-name>
- <managed-bean-class>
- org.apache.myfaces.blank.HelloWorldBacking
- managed-bean-class>
- <managed-bean-scope>requestmanaged-bean-scope>
- managed-bean>
- <!---->
- <navigation-rule>
- <from-view-id>/helloWorld.jspfrom-view-id>
- <navigation-case>
- <from-outcome>successfrom-outcome>
- <to-view-id>/page2.jspto-view-id>
- navigation-case>
- navigation-rule>
- <!---->
- <navigation-rule>
- <from-view-id>/page2.jspfrom-view-id>
- <navigation-case>
- <from-outcome>backfrom-outcome>
- <to-view-id>/helloWorld.jspto-view-id>
- navigation-case>
- navigation-rule>
- faces-config>
Refrence:
1,http://jira.opensymphony.com/browse/SIM-201
2,http://java.chinaitlab.com/JBoss/390987.html
3,http://java.chinaitlab.com/JBoss/390987.html
- SMViewHandler.zip (5.5 KB)
- 描述: SMViewHandler.zip
- 下载次数: 51
- sitemesh-2.3.jar (184.7 KB)
- 描述: 已经编译好,可以直接使用
- 下载次数: 107
评论
发表评论
-
IBM jsf row select
2009-07-09 19:09 1245http://www.ibm.com/developerwor ... -
jsf中使用Locale,显示本地化错误信息
2009-01-15 11:09 3330JSF 在转换和验证时都有可能会产生错误信息: 在使用标准转 ... -
JSF中制作双表尾
2008-11-21 21:42 1654最近,在项目中遇到一个制作表尾的问题,效果 如下: ... -
JSF1.2中 ValueExpression的用法
2008-05-22 23:20 4853在1.2之前,可以向下面一样使用ValueBinding: V ... -
Tomcat中如何打开Sun JSF RI 1.2中的日志
2008-05-16 00:50 3549为了更加清楚的了解JSF请求在每一个生命周期中的执行情况,我们 ... -
JSF环境配置(JDK6+Eclipse3.3+Tomcat 6.0+JSF1.2+JSTL1.1)
2008-04-25 23:14 6965第一步: 下载安装 JDK 6 Update 3 h ... -
不可不看,JSF1.2 changes
2008-03-31 17:04 4271变化还是挺多的,仔细看看,可以省掉很多郁闷的时间哦。The n ... -
JSTL 1.2 下载
2008-03-31 14:26 30643在网上找JSTL找了一会,不太好找,就放在这里一份了: 网络下 ... -
JSF 1.2中对以前JSF的修改
2008-03-31 11:00 1880Features that are unavailable ... -
JSF 各版本一览
2008-03-28 18:03 3478JSF started its journey from ve ... -
JSF 背景
2008-03-25 17:29 1738自从第一个web应用程序Struts于2001年6月发布开始, ... -
在Dreamwear中开发JSF
2008-03-09 22:49 2691可以在Dreamwear中安装JSF插件,然后利用Dreamw ... -
JSF中Exception的处理
2007-12-21 15:54 4863JSF中Exception的处理<o:p>< ... -
JSF中Exception的处理
2007-12-21 14:56 78目标: 解析错误信息,使用Globalization 来显示 ... -
Why JSF
2007-12-17 16:03 1262JavaServer Faces is extremely i ... -
源码讲解renderResponse和responseComplete的区别
2007-11-17 00:40 4442看源代码: responseComplete: ... -
JSF 源代码赏析之Lifecycle
2007-11-15 23:41 5898JSF的生命周期在JSF ... -
如何在Maven中配置Richfaces
2007-11-08 17:41 29451.首先到这个地方下载maven http://maven. ... -
JSF 标准 转换器&验证器 文档
2007-11-02 18:50 2231下面是两篇文档 http://www.ibm.com/deve ... -
JSF 源代码赏析之FacesServlet
2007-10-30 00:08 12512学习JSF 多日,现在开始看看源代码。 首先是FacesSer ...
相关推荐
springmvc + mybatis + sitemesh3 超简洁例子 整合springmvc mybatis 方法请看: http://blog.csdn.net/kokoyuo/article/details/52808510
NULL 博文链接:https://javawxl.iteye.com/blog/2323096
SiteMesh是一个网页布局和装饰框架以及Web应用程序集成框架,可帮助创建由页面组成的网站,这些页面需要一致的外观,导航和布局方案。 SiteMesh会拦截对通过Web服务器请求的任何静态或动态生成的HTML页面的请求,...
web布局框架 SiteMesh教程及SiteMesh官方文档翻译
sitemesh 装饰 母版
siteMesh demo siteMesh使用文档
sitemesh.jar包 sitemesh.jar 包sitemesh.jar 包sitemesh.jar包
SiteMesh 是一个网页布局和修饰的框架,利用它可以将网页的内容和页面结构分离,以达到页面...尽管它是由java语言来实现的,但它能与其他Web应用很好地集成。下图是SiteMesh的结构图 标签:SiteMesh Web框架
在WebWork中集成SiteMesh相当容易: 实际上什么也不用做. WebWork把全部值栈数据都保存在请求attribute中, 这意味着如果想显示值栈(或ActionContext)中的数据, 只需使用WebWork附带的标准标签库, 就这么简单!那来看完...
MiddleGen-Hibernate: 本书使用版本:2.1 ... modtime=1096973436&big_mirror=0 下载文件:middlegen-2.1.zip MiddleGenIDE插件: 本书使用版本:1.2.0 ...(7)Sitemesh: ...下载文件:sitemesh-2.3.zip
sitemesh-2.2.1.jar
sitemesh 装饰页面技术.
很简单的sitemesh入门教程,希望对大家有所帮助
Struts 2.0提供一个Sitemesh插件,允许在Sitemesh模板中使用Struts标记。 要使用Sitemesh需要包含Freemark,Sitemesh和Sitemesh插件库文件。 配置过滤器 如果需要使用Freemark模板文件作为装饰器文件,需要在web....
sitemesh-2.4.1.jar sitemesh-2.4.1.jar sitemesh-2.4.1.jar sitemesh-2.4.1.jar sitemesh-2.4.1.jar sitemesh-2.4.1.jar
sitemesh jar包sitemesh jar包sitemesh jar包sitemesh jar包sitemesh jar包sitemesh jar包sitemesh jar包
springMVC与sitemesh的结合,
SiteMesh教程.pdf
spring-boot-sitemesh 源码整合
sitemesh入门demo。博客 Sitemesh入门和使用笔记 对应源码