EmployeeAction.java
--------------------------------------
package org.taink.struts.action;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts二.ServletActionContext;
import com.opensymphony.xwork二.ActionContext;
public class EmployeeAction {
public String execute() {
ActionContext actionContext = ActionContext.getContext();
actionContext.getApplication().put("application", "application 施用范畴");
System.out.println(actionContext.getApplication().get("application"));
actionContext.getSession().put("session", "session 运用范畴");
System.out.println(actionContext.getSession().get("session"));
actionContext.put("request", "request 运用范畴");
System.out.println(actionContext.get("request"));
return "success";
}
public String test() {
ServletContext servletContext = ServletActionContext.getServletContext();
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
HttpSession session = request.getSession();
request.setAttribute("request", "request**施用范畴");
session.setAttribute("session", "session**运用范畴");
servletContext.setAttribute("application", "application**施用范畴");
return "success";
}
}
本文来源:
我的异常网
Java Exception
Dotnet Exception
Oracle Exception
- 3086 - 严重: Error listenerStart
- 3087 - 抛异常
- 3088 - Exception starting filter struts2
- 3089 - Caused by: java.lang.NullPointerException
- 3090 - java.lang.ClassNotFoundException: jmc GuiMidlet
- 3091 - og4j:WARN No appenders could be found for logger org.apache.commons.digester.Digester.sax
- 3092 - org.hibernate.exception.SQLGrammarException: Cannot open connection
- 3093 - Exception in thread 'main' java.lang.NullPointerException
- 3094 - org.hibernate.exception.GenericJDBCException: Cannot open connection
- 3095 - org.springframework.orm.hibernate3.HibernateSystemException: ids for this class must be manually assigned before calling save