struts.xml 配置:
<action name="FilterLoginAction" class="org.zhaojiandong.struts2.FilterLoginAction">
<result name="success" type="redirect">
<param name="location">/filter/loginsuccess.jsp</param>
<param name="fusername">${username}</param>
<param name="fpassword">${password}</param>
</result>
<result name="input">/filter/login.jsp</result>
</action>在jsp中调用的方法:
<%String username = request.getParameter("fusername");
String password_str = request.getParameter("fpassword);
%>
用户名:<%=username_str%><br/>
密码:<%=password_str %><br/> </body>
本文详细介绍了Struts框架中如何配置Action并使用JSP进行方法调用,包括配置文件struts.xml的使用,以及在JSP页面中获取并展示从Action传来的参数。
6880

被折叠的 条评论
为什么被折叠?



