新手求助!这样的错误怎么解决 ? 应该是struts下的应用,检查一下web.xml中ActionMappings 和 ActionFormBeans 的设置 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 是struts下的应用web.xml中ActionMappings 和 ActionFormBeans 是怎样设置的.web.xml的内容:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"><web-app> <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> <load-on-startup>2</load-on-startup> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <taglib> <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri> <taglib-location>/WEB-INF/struts-template.tld</taglib-location> </taglib></web-app>struts-config 的设置:<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd"><struts-config> <form-beans> <form-bean name="loginActionForm" type="struts.LoginActionForm" /> </form-beans> <action-mappings> <action name="loginActionForm" type="struts.LoginAction" input="/Login.jsp" path="/loginAction" /> </action-mappings></struts-config>loginAction.java:package struts;import org.apache.struts.action.*;import javax.servlet.http.*;public class LoginAction extends Action { public ActionForward perform(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { /**@todo: complete the business logic here, this is just a skeleton.*/ throw new java.lang.UnsupportedOperationException("Method perform() not yet implemented."); }}loginActionForm.java:package struts;import org.apache.struts.action.*;import javax.servlet.http.*;public class LoginActionForm extends ActionForm { private String name; public void setName(String name) { this.name = name; } public String getName() { return name; } public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { /**@todo: finish this method, this is just the skeleton.*/ return null; } public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { }}login.jsp:<%@ page contentType="text/html; charset=GBK" %><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %><html:html><head><title>Login</title></head><body><h1>JBuilder Generated Struts JSP for ActionForm struts.LoginActionForm</h1><p><html:form action="/loginAction.do" method="POST"><html:text property="name"/><br><html:submit property="submit" value="Submit"/><br><html:reset value ="Reset"/></html:form></body></html:html> SEAM工程从JBOSS迁移到WebSphere遇到的一个问题 指教指教!! There is no Action mapped for action name ... 一个Compass+ssh中cmd配置文件的问题 flash与数据库交互的问题 求助一段代码或思路 没有java基础,可以搞jsp页面吗? jsp页面弹出窗口的参数传递问题... 请问各位高手怎么用tomcat发布中文名的jsp页? 配置tomcat以后,运行出错? 我想学java,不知道都应学什么?敬请赐教 升级JDK后还要重新安装TOMCAT吗
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<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>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
</web-app>struts-config 的设置:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
<form-beans>
<form-bean name="loginActionForm" type="struts.LoginActionForm" />
</form-beans>
<action-mappings>
<action name="loginActionForm" type="struts.LoginAction" input="/Login.jsp" path="/loginAction" />
</action-mappings>
</struts-config>loginAction.java:
package struts;import org.apache.struts.action.*;
import javax.servlet.http.*;public class LoginAction extends Action {
public ActionForward perform(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
/**@todo: complete the business logic here, this is just a skeleton.*/
throw new java.lang.UnsupportedOperationException("Method perform() not yet implemented.");
}
}loginActionForm.java:
package struts;import org.apache.struts.action.*;
import javax.servlet.http.*;public class LoginActionForm extends ActionForm {
private String name;
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
/**@todo: finish this method, this is just the skeleton.*/
return null;
}
public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
}
}
login.jsp:
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
<head>
<title>
Login
</title>
</head>
<body>
<h1>JBuilder Generated Struts JSP for ActionForm struts.LoginActionForm</h1>
<p>
<html:form action="/loginAction.do" method="POST">
<html:text property="name"/>
<br>
<html:submit property="submit" value="Submit"/><br>
<html:reset value ="Reset"/>
</html:form>
</body>
</html:html>