struts 中jsp不能指向action中函数

jsp:

loginAction.do?method=view

 

struts-config:

<action attribute="loginForm" name="loginForm"
   path="/loginAction" scope="request"
   type="org.springframework.web.struts.DelegatingActionProxy"
   parameter="method">
   <forward name="success" path="/login.jsp"></forward>
   <forward name="failed" path="/failed.jsp"></forward>
  </action>

 

applicationContext.xml:

<beans default-autowire="byName">

 <bean name="/loginAction" class="com.yourcompany.struts.action.LoginAction"/>

 

action:

public ActionForward execute(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response)

public ActionForward view(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response)

 

为什么jsp 上面我指向了view 但是依然是走了execute?怎么解决?

 

action是继承 dispatchaction?

Action需要继承DispatchAction

1 action是继承 dispatchaction

2 删除execute方法,添加parameter参数指定的方法