一个让人很无奈的struts问题……

liajin 2005-02-17 12:02:29
开发环境:JuilderX+Weblogic+Win2000Server
错误状态:
1、在tomcat下能正常运行;
2、在weblogic8下出现如果下错误信息:
……
<2005-2-17 上午11时53分50秒 CST> <Error> <HTTP> <BEA-101020> <[ServletContext(id=9201258,name=myweb,context-path=/myweb)] Servlet failed with Exception

weblogic.servlet.jsp.JspException: (line 6): 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:5081)

at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java:4919)

at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java:4765)

at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:2143)

at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1929)

at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1802)

at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:963)

at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1209)

at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1183)

at weblogic.servlet.jsp.JspLexer.buildTimeInclude(JspLexer.java:934)

at weblogic.servlet.jsp.JspLexer.mINCLUDE_DIRECTIVE(JspLexer.java:5017)

at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java:4775)

at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:2143)

at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1929)

at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1802)

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:232)

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:388)

at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:238)

at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:188)

at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:535)

at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:373)

at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)

at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)

at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)

at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)

at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

>
...全文
122 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
liajin 2005-02-17
  • 打赏
  • 举报
回复
那为什么用tomcat4没有产生版本啊
z3h 2005-02-17
  • 打赏
  • 举报
回复
class 'org.apache.struts.taglib.html.FormTag' has no setter method corresponding to TLD declared attribute 'name', (JSP 1.1 spec, 5.4.1)
已经说清楚了.应该是你用的tld文件和jar不是同一个版本.
chubbchubb 2005-02-17
  • 打赏
  • 举报
回复

这个我遇到过。
是因为你使用的struts-html.tld是struts1.1的,而你使用的struts.jar是1.2
所以就....

原因:
在struts1.2里,<html:form>这个tag没有name属性了。
只需要指定action="XXX.do"就可以了
<html:form action="XXX.do">

这个form会从XXX.do取得formbean的name


liajin 2005-02-17
  • 打赏
  • 举报
回复
在线等……
chubbchubb 2005-02-17
  • 打赏
  • 举报
回复
可能是tomcat的一致性检查不严格吧。
liajin 2005-02-17
  • 打赏
  • 举报
回复
我把struts.jar环城了1.1的版本后问题的确解决了
疑问:为什么用tomcat4没有产生版本啊?
谢谢了先!!!

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧