简单的struts应用程序需要运行互联网吗?

时间:2011-02-17 06:40:32

标签: java eclipse jboss struts

我正在开发一个简单的struts应用程序。

使用的工具:

  • IDE:Eclipse helios
  • 服务器:jboss 4.0.5 从网站安装eclipse插件:

http://download.jboss.org/jbosstools/updates/nightly/trunk/ 只选择了struts开发。

一切都很好。

创建了动态Web应用程序并添加了struts功能。 支柱是:1.2 它会自动将tld文件复制到WEB-INF。在jsp文件中,taglib uri指向web-inf目录。

当我使用html struts标签时,所有标签都正常工作:除了

我的标签是:

<html:form action="/new.do" >
<html:text property="uname">uname</html:text>
<html:submit></html:submit>

.. 这个简单的项目,需要一些输入并转发给它的jsp页面。

由于缺乏互联网,该项目无法正常运行,但在互联网的早期工作正常,行动正在转发。

在没有互联网的情况下抛出错误如下:

11:56:05,375 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
    at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:798)
    at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
    at org.apache.jsp.index_jsp._jspx_meth_html_form_0(index_jsp.java:130)
    at org.apache.jsp.index_jsp._jspx_meth_html_html_0(index_jsp.java:104)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:75)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
    at java.lang.Thread.run(Unknown Source)

请任何人帮助这个!!! 提前谢谢

2 个答案:

答案 0 :(得分:0)

也许这就是问题... Taglibs网址是absolute而不是relative ...这就是为什么当互联网开启时它起作用..否则它不会。

答案 1 :(得分:0)

也许您需要在eclipse中本地包含库,而不是引用在线资源。