name="dynamicloginForm"
type="com.mycompany.action.dynamic_action"
scope="request">
---------------------------------
action
org.apache.struts.action.ActionServlet
config
/WEB-INF/struts-config.xml
debug
3
detail
3
0
action
*.do
pages/dynamic_login.jsp
----------------------------------
package com.mycompany.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;
public class dynamic_action extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
DynaActionForm dform = (DynaActionForm) form;
String sname = (String)dform.get("usrname");
System.out.println(sname);
return mapping.findForward("success");
}
}
--------------------
<%@ page language="java" pageEncoding="GB2312"%>
<%@ taglib uri="" prefix="bean" %>
<%@ taglib uri="" prefix="html" %>
<%@ taglib uri="" prefix="logic" %>
<%@ taglib uri="" prefix="tiles" %>
dynamic_login.jsp
This a struts page.
动态action测试
阅读(1151) | 评论(0) | 转发(0) |