错误状态:
1、在tomcat下能正常运行;
2、在weblogic8.15下出现如果下错误信息:
<2007-7-6 上午10时53分59秒 CST> <Error> <HTTP> <BEA-101020> <[ServletContext(id=19676610,name=track,context-path=/track)] Servlet failed with Exception
weblogic.servlet.jsp.JspException: (line 3): Error in using tag library uri='/WEB-INF/struts-html.tld' prefix='html': The Tag class 'org.apache.struts.taglib.html.FormTag' has no setter method corresponding to TLD declared attribute 'name', (JSP 1.1 spec, 5.4.1)
at weblogic.servlet.jsp.StandardTagLib.tld_jspException(StandardTagLib.java:1243)
at weblogic.servlet.jsp.StandardTagLib.parseTagDD(StandardTagLib.java:1371)
at weblogic.servlet.jsp.StandardTagLib.parseDD(StandardTagLib.java:1269)
at weblogic.servlet.jsp.StandardTagLib.<init>(StandardTagLib.java:292)
at weblogic.servlet.jsp.TagLibHelper.loadTagLib(TagLibHelper.java:314)
at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:145)
at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java:5067)
at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java:4905)
at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java:4751)
at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:2161)
at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1947)
at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1820)
at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:963)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java:106)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:234)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:125)
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:396)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:246)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:196)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:598)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:406)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:348)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6985)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3892)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2766)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
>
原因:
是因为你使用的struts-html.tld和使用的struts.jar不是同一个版本的(用的tld文件和jar不是同一个版本)。
解决:把Struts.jar的tld解压替换/WEB-INF/下的tld(包括struts-bean.tld、struts-html.tld、 struts-tiles.tld、struts-logic.tld、struts-nested.tld、struts-template.tld)
(或者2:你使用的struts-html.tld是struts1.1的,而你使用的struts.jar是1.2,所以.....
把struts.jar替换成1.1的版本问题解决)