JSP:
<html>
<body>
<form action="/test/action" method="post">
<input type="submit" value="submit"/>
</form>
</body>
</html>
struts-config.xml:
<action path="/test/action" type="org.apache.struts.actions.ForwardAction" parameter="/pages/Welcome.jsp"/>报错:The requested resource (/test/action) is not available.
改变jsp为(struts-config.xml同上):
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<html:html>
<body>
<html:form action="/test/action" method="post">
<input type="submit" value="submit"/>
</html:form>
</body>
</html:html>报错:
org.apache.jasper.JasperException: Cannot retrieve definition for form bean null
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
<html>
<body>
<form action="/test/action" method="post">
<input type="submit" value="submit"/>
</form>
</body>
</html>
struts-config.xml:
<action path="/test/action" type="org.apache.struts.actions.ForwardAction" parameter="/pages/Welcome.jsp"/>报错:The requested resource (/test/action) is not available.
改变jsp为(struts-config.xml同上):
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<html:html>
<body>
<html:form action="/test/action" method="post">
<input type="submit" value="submit"/>
</html:form>
</body>
</html:html>报错:
org.apache.jasper.JasperException: Cannot retrieve definition for form bean null
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
type="org.apache.struts.actions.ForwardAction"
parameter="/pages/Welcome.jsp">
name="..."//form definition here
</action>
是不是要配个action form??
<form 这么写要加上上下文,比如mywebapp
问题解决了
<html>
<body>
<form action="actiontest.do" method="post">
<input type="submit" value="submit"/>
</form>
</body>
</html>要加.do