首选在action中:request.setAttribute("emId",emId);
转发到JSP中,然后在jsp中:
<logic:present name="emId" scope="request">
<html:form action="/updateEnrolmentMessage.do?emId=${emId}" method="post">
...
</html:form>
</logic:present>
然后在struct-config.xml中这样配置
<action path="/updateEnrolmentMessage" validate="true"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="success" path="/WEB-INF/jsp/Message.jsp"/>
</action>
报错为:
Cannot retrieve definition for form bean null on action /updateEnrolmentMessage.do?emId=1
我的理解是这里有问题:action="/updateEnrolmentMessage.do?emId=${emId}" ,意思是在struts-config.xml中没有配置的路径,如果用一个隐藏域来接收emId的话,那对应的Form不是也得更改了吗?
请问这样传参数的问题,应该怎么解决呢.
转发到JSP中,然后在jsp中:
<logic:present name="emId" scope="request">
<html:form action="/updateEnrolmentMessage.do?emId=${emId}" method="post">
...
</html:form>
</logic:present>
然后在struct-config.xml中这样配置
<action path="/updateEnrolmentMessage" validate="true"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="success" path="/WEB-INF/jsp/Message.jsp"/>
</action>
报错为:
Cannot retrieve definition for form bean null on action /updateEnrolmentMessage.do?emId=1
我的理解是这里有问题:action="/updateEnrolmentMessage.do?emId=${emId}" ,意思是在struts-config.xml中没有配置的路径,如果用一个隐藏域来接收emId的话,那对应的Form不是也得更改了吗?
请问这样传参数的问题,应该怎么解决呢.