关于STRUTS的标签,请高手指教,快发疯了

06-06-03 rasclewen
前些天开始做个小项目,用STRUTS,一开始用普通的JSP页面的时候没出现问题,但前天将JSP页面换作STUTS的标签,却报JSP不能编译错误,错误提示在下面,

页面也引入了LIB标签,更让人费解的是如果只保留标签页面可以正常显示,一但加入就会出上面的错误,更让人发疯的是,我直接将虚拟目录指向STRUTS的例子里,居然也报相同的错误,看来不是我程序的问题,哪位大侠知道这个原因在哪,我都快疯了!

附:

我用的是jboss3.2.6 和 STRUTS1.2.9

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP

Generated servlet error:

D:\jboss326\server\default\work\jboss.web\localhost\xt\org\apache\jsp\register_jsp.java:101: _jspx_meth_bean_message_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.register_jsp cannot be applied to (org.apache.struts.taglib.html.HtmlTag,javax.servlet.jsp.PageContext)

if (_jspx_meth_bean_message_0(_jspx_th_html_html_0, _jspx_page_context))

^

Generated servlet error:

D:\jboss326\server\default\work\jboss.web\localhost\xt\org\apache\jsp\register_jsp.java:119: _jspx_meth_bean_message_1(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.register_jsp cannot be applied to (org.apache.struts.taglib.logic.MessagesPresentTag,javax.servlet.jsp.PageContext)

if (_jspx_meth_bean_message_1(_jspx_th_logic_messagesPresent_0, _jspx_page_context))

^

Generated servlet error:

D:\jboss326\server\default\work\jboss.web\localhost\xt\org\apache\jsp\register_jsp.java:141: _jspx_meth_bean_write_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.register_jsp cannot be applied to (org.apache.struts.taglib.html.MessagesTag,javax.servlet.jsp.PageContext)

if (_jspx_meth_bean_write_0(_jspx_th_html_messages_0, _jspx_page_context))

^

Generated servlet error:

D:\jboss326\server\default\work\jboss.web\localhost\xt\org\apache\jsp\register_jsp.java:468: _jspx_meth_html_form_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.register_jsp cannot be applied to (org.apache.struts.taglib.html.HtmlTag,javax.servlet.jsp.PageContext)

if (_jspx_meth_html_form_0(_jspx_th_html_html_0, _jspx_page_context))

^

Generated servlet error:

D:\jboss326\server\default\work\jboss.web\localhost\xt\org\apache\jsp\register_jsp.java:558: _jspx_meth_html_hidden_0(javax.servlet.jsp.tagext.JspTag,javax.servlet.jsp.PageContext) in org.apache.jsp.register_jsp cannot be applied to (org.apache.struts.taglib.html.FormTag,javax.servlet.jsp.PageContext)

if (_jspx_meth_html_hidden_0(_jspx_th_html_form_0, _jspx_page_context))

^

5 errors

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)

org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)

org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)

note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.

我的WEB.xml文件中标签写法

/tags/struts-bean

/WEB-INF/struts-bean.tld

/tags/struts-html

/WEB-INF/struts-html.tld

/tags/struts-logic

/WEB-INF/struts-logic.tld

---------

但是如果换成 weblogic7.1就没有问题呀,请多多指教。在线等待。

rasclewen
2006-06-03 14:49
就是说能识别《html:html》,但不能识别《html:form》 《bean:message》等等,怪事呀。

rasclewen
2006-06-08 22:17
看来,只能靠自己了。

我把jboss3.2.6 换成 4.0.2 就可以,我怀疑 3.2.6 和 struts1.2.9有些包不兼容。

猜你喜欢