我按照书上的例子做个student登录框,但是在运行的时候eclipse出现了
http status 404 Servlet strutsController is not available这个错误!type Status reportmessage Servlet strutsController is not availabledescription The requested resource (Servlet strutsController is not available) is not available.
这是为什么?还有我用的是struts2.0.11版本解压有在lib下没有digester.jar这个文件的!奇怪!
http status 404 Servlet strutsController is not available这个错误!type Status reportmessage Servlet strutsController is not availabledescription The requested resource (Servlet strutsController is not available) is not available.
这是为什么?还有我用的是struts2.0.11版本解压有在lib下没有digester.jar这个文件的!奇怪!
解决方案 »
- HibernateTemplate.delete和deleteAll失效?
- jsp页面调用js中文乱码
- 请问一下:怎么动态的给<jsp:include>传参数? 急啊!!!!!!!!!!
- 字符编码的问题
- 文件上传功能-如何在客户端取文件最后修改时间?
- JSF页面的output标签如何取值
- 散分!!!谁能帮我解决jsp参数过滤、防sql注入问题?100分全给!
- 超链接为Excel文件 但显示的确是乱码 问题 急~~
- 求一个可以下载连接人数为500以上的REALSERVER8.0的下载地址(重分,若你觉得这些分不够还可以再加)
- 关于日文乱码的问题,请进
- 连接数据库出错,请各位帮看看原因!!!!
- 如何用hinernate的方法取得oracle中clob对象的值?
struts-config.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<struts-config>
<form-beans>
<form-bean name="stuForm" type="model.StudentForm"/>
</form-beans>
<global-exceptions/>
<action-mappings>
<action path="/reg" name="stuForm" type="model.RegAction" scope="request" input="/reg.jsp">
<forward name="stu_list" path="/stu_list.jsp"/>
</action>
</action-mappings>
</struts-config>
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts</display-name>
<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>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
如果把web.xml中的servlet标签内的servlet内容去掉就可以运行html代码,如果不去掉就出现reg.do) is not available.错误!这两个xml都在WEB-INF文件下!
还有RegAction在项目包下的src文件夹下的model包中!
package model;
/*******************************************************************************
* Copyright (c) 2005 Eteration A.S. and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: Eteration A.S. - initial API and implementation
******************************************************************************/
//default packageimport java.io.IOException;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;public class RegAction extends Action
{
public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException
{
BM.insertStu((StudentForm)form);
request.setAttribute("list", BM.getAllStu());
return mapping.findForward("stu_list");
}
}