<html:form action="/aa.do">
<html:submit/>
</html:form>

解决方案 »

  1. <form action="/应用名/aa.do" method="post">
    要在web.xml中配置
    <servlet> 
    <servlet-name>ActionServlet</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>5</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet> 

    <servlet-mapping> 
    <servlet-name>ActionServlet</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping> 然后在struts-config.xml中配置

    <action-mappings>
    <action path="/aa" type="basic.LoginAction"-->这里写你的javabean
    >
    <forward name="loginOk" path="/day1/ok.jsp" />
    <forward name="loginError" path="/day1/error.jsp" />
    </action>
    </action-mappings>
      

类似问题 »