当前位置: 代码迷 >> 综合 >> 2.Strut国际化动态文本(声明式处理异常):ActionForm
  详细解决方案

2.Strut国际化动态文本(声明式处理异常):ActionForm

热度:42   发布时间:2024-01-17 02:52:34.0
package com.bjpowernode.i18n;import java.io.UnsupportedEncodingException;import javax.servlet.http.HttpServletRequest;import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;/*** 登录ActionForm,负责表单收集数据* 表单的属性必须和ActionForm中的get和set的属性一致* @author Administrator**/
@SuppressWarnings("serial")
public class LoginActionForm extends ActionForm {private String username;private String password;public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}@Overridepublic void reset(ActionMapping mapping, HttpServletRequest request) {try {request.setCharacterEncoding("GB18030");} catch (UnsupportedEncodingException e) {e.printStackTrace();} }
}