比如超级连接是这样的
<a herf="aaaaa.do"></a>
我想让用户点击这个以后
我的一个action这个中的一个方法开始执行,这个需要怎么写?

解决方案 »

  1.   

    这个题目很大哦,
    你先得写好配置文件,最好继承下内置的Struts action 比如 LookupDispatchAction.
    用配置文件告诉系统用哪个Action的哪个方法执行/.
      

  2.   

    仅是页面转向问题的话 还可以向你那么用
    如果用到action的话 在struts-config.xml指定下action的forword
      

  3.   

    重写Action的excute方法, 调用你的这个方法即可
      

  4.   

    dispatchAction啊,***.do?method=方法名&参数=
      

  5.   

    dispatchAction啊,***.do?method=方法名&参数=-----------------------------------------------
    这个能详细点说吗
      

  6.   

    public xxxxAction extends DispatchAction{
      public ActionForward methodName(
    ActionMapping actionMapping,
    ActionForm actionForm,
    HttpServletRequest httpServletRequest,
    HttpServletResponse httpServletResponse)
    throws Exception {
                 ......
      }
    }在struts-config.xml中
    <action  parameter="method" path="/package/loginAction" type="package.xxxxxxAction" validate="false" >
    <forward ..../>
    </action>jsp页面
    <html:form action="/package/loginAction.do?method=methodName&paramter=xxxxxx" method="post">...
    </html:form>
      

  7.   

    struts-config.xml
    <action path="/saveSubscription" 
            type="org.apache.struts.actions.DispatchAction"
            name="subscriptionForm" scope="request" input="/subscription.jsp"    
            parameter="method"/>
    parameter的属性值是可以任意起的,只要你记得在传参数的时候统一就可以了。比如我写了一个类似这样的Action,它继承自DispatchAction类,包含了三个操作方法,有Add(),Update(),Delete()。当我想要调用这个Action的Update操作时,提交的URL应该类似这样的:
    http://localhost:8080/myapp/saveSubscription.do?method=update