- 论坛徽章:
- 0
|
懒的境界在于操作懒而脑袋不能懒
想偷懒就要多看多想
懒得废话,看配置和程序吧
struts-config.xml
JSP
JSP for lazyForm form
用户名
年龄
密码
文件
选择1
选择2
非用户信息
Action
package test;
import javax.servlet.http.*;
import org.apache.commons.beanutils.*;
import org.apache.struts.action.*;
import org.apache.struts.actions.*;
import org.apache.struts.upload.*;
public class UserAction extends DispatchAction {
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward addUser(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
DynaBean lazyForm = (DynaBean) form;
System.out.println(lazyForm.get("c1"));
System.out.println(((FormFile) lazyForm.get("testfile")).getFileSize());
System.out.println(lazyForm.get("user"));
return mapping.findForward("addUser");
}
}
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/38180/showart_421587.html |
|