大伙帮我看看,这个异常

flowersong 2005-06-07 08:53:30
javax.servlet.ServletException: Cannot find bean HtmlFileForm in any scope
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.jsp.Welcome_jsp._jspService(Welcome_jsp.java:93)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
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)

可是我在struts config.xml里配置了,为啥还抛这个异常
...全文
66 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
hongke1490 2005-06-07
  • 打赏
  • 举报
回复
是不是大小写的问题,检查一下jsp文件
King6860 2005-06-07
  • 打赏
  • 举报
回复
你好好检查一下,看你的FORMBEAN 是不是 放在了CLASSES 下面。。
aqining 2005-06-07
  • 打赏
  • 举报
回复
Cannot find bean HtmlFileForm in any scope.
在任何域中都找不到HtmlFileForm 的实例!
我在做的时候好像碰到类似的问题,你在HtmlFileForm中添加一个空的构造函数,试试看
flowersong 2005-06-07
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<struts-config>
<form-beans>
<form-bean name="htmlFileForm"
type="htmltaglibs.forms.HtmlFileForm" />
</form-beans>
<action-mappings>
<action path="/htmlFileAction"
type="htmltaglibs.actions.HtmlFileAction" name="htmlFileForm"
scope="request" input="/hello.jsp" validate="false">
<forward name="success" path="/jsp/Welcome.jsp" />
<forward name="error" path="/jsp/ErrorJsp.jsp" />
</action>
</action-mappings>
</struts-config>

这是struts config.xml
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>
<display-name>test1</display-name>

<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>


<!-- Standard Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>


<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>hello.jsp</welcome-file>
</welcome-file-list>


<!-- Struts Tag Library Descriptors -->
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-html.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-logic.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-nested</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-nested.tld</taglib-location>
</taglib>

<taglib>
<taglib-uri>/tags/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/tld/struts-tiles.tld</taglib-location>
</taglib>

</web-app>
这是 web.xml
flowersong 2005-06-07
  • 打赏
  • 举报
回复
好,你等会
flowersong 2005-06-07
  • 打赏
  • 举报
回复
UP
ipv 2005-06-07
  • 打赏
  • 举报
回复
没遇到过
相关代码和配置文件贴出来
flowersong 2005-06-07
  • 打赏
  • 举报
回复
up

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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