十二月 18, 2015 10:20:05 上午 com.opensymphony.xwork2.util.logging.jdk.JdkLogger error
严重: Developer Notification (set struts.devMode to false to disable this message):
Unexpected Exception caught setting 'name' on 'class action.LoginAction1: Error setting expression 'name' with value ['aaa', ]
十二月 18, 2015 10:20:05 上午 com.opensymphony.xwork2.util.logging.jdk.JdkLogger error
严重: Developer Notification (set struts.devMode to false to disable this message):
Unexpected Exception caught setting 'password' on 'class action.LoginAction1: Error setting expression 'password' with value ['aaa', ]
index.jsp:
<?xml version="1.0" encoding="GB18030" ?>
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
用户名:
密码:
struts.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<!-- -->
<!-- -->
/user_login_success.jsp
action:
package action;
import java.util.Map;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class LoginAction1 extends ActionSupport {
private Map request;
private Map session;
private Map application;
public LoginAction1() {
request = (Map)ActionContext.getContext().get("request");
session = ActionContext.getContext().getSession();
application = ActionContext.getContext().getApplication();
}
public String execute() {
request.put("r1", "r1");
session.put("s1", "s1");
application.put("a1", "a1");
return SUCCESS;
}
}