servletContext 和 application 的区别
src url:http://www.blogjava.net/vickzhu/archive/2008/08/20/223171.html
其实servletContext和application 是一样的,就相当于一个类创建了两个不同名称的变量
大家只要打开jsp编译过后生成的Servlet中的_jspService()方法就可以看到如下的声明:
ServletContext application = null;
两者的区别就是application用在jsp中,servletContext用在servlet中
分享到:
相关推荐
Application对象(ServletContext对象).pptx
快速认清pageContext,request,session,application/ServletContext的区别。 区别1:生命周期 区别2:共享范围 区别3:适合存储什么样的数据
java总结.rar.......................
注解配置SpringMVC原理简述1. 准备知识1.1 两个应用上下文1.2 ServletContext配置方法(Configuration Methods)1.3 运行时插拔1.4 SpringServletContainerInitializer1.4.1 AbstractContextLoaderInitializer1.4.2 ...
本次工程的目标是学习监听器,掌握监听三个对象的创建和销毁方法。 三个对象:rquest,session,ServletContext 实现的接口:ServletRequestListener,HttpSessionListener,ServletContextListener 工程的大致步骤...
AnyFo - Util - AnyFoAction AnyFoAction介绍 AnyFoAction是AnyFo - Util下的一个子项目,其中只包含一个类,这个类专门用来对Struts2.0中的控制器提供方便的操作。...获得ServletContext,即俗称的Application
之前上传了一个通过Flash实现多...方法二:在application(ServletContext)里保存一个session管理器HashMap:sessionId---sessionRef,这样可以在所有的servlet/jsp里调用,这需要在url里将sessionId以参数形式传递,如...
7 ServletContext getContext(String uripath) 返回指定WebApplication的application对象 8 int getMajorVersion() 返回服务器支持的Servlet API的最大版本号 9 int getMinorVersion() 返回服务器支持的Servlet...
从加载过程我们可以看到,首先从Servlet事件中得到ServletContext,然后可以读到配置好的在web.xml的中的各个属性值,然后ContextLoder实例化WebApplicationContext并完成其载入和初始化作为根上下文。当这个根上...
response.setContentType("application/x-download"); //File exportFile = new File(realName); //response.setContentLength((int) exportFile.length()); ServletOutputStream servletOutputStream ...
ServletContext application = super.getServletContext(); // 获取application对象(Servlet上下文对象) String contextPath = request.getContextPath(); // 获取上下文路径(重定向) String opr = request....
application servlet 正在执行的内容 out 用来传送回应的输出 config servlet的构架部件 page JSP网页本身 exception 针对错误网页,未捕捉的例外 request表示HttpServletRequest对象。它包含了...
它们基本上就和JSP的pageContext、request、session和application一样; 在EL中,这四个隐含对象只能用来取得范围属性值,即getAttribute(String name),却不能取得 其他相关信息。 例如:我们要取得session中...
Notification that the web application initialization process is starting. Cookie - class javax.servlet.http.Cookie. Creates a cookie, a small amount of information sent by a servlet to a Web browser,...
public class AmpList implements ServletContextListener,HttpSessionListener,HttpSessionAttributeListener { private ServletContext application=null; public void contextInitialized(ServletContext
ServletContext application = getServletContext(); // 显示的列表 if ("show".equals(action)) { // 调用service层方法得到所有的 String temp = req.getParameter("page"); int page = 1; if...
它还提供了从管理ServletContext到泽西ServiceLocator访问权限,许多Dropwizard组件的默认绑定,例如Validator , ObjectMapper , MetricRegistry , HealthCheckRegistry ,您的Application ,您的Configuration ...
${pageContext.request.remoteUser} 取得用户名称${pageContext.request.remoteAddr } 取得用户的IP 地址${pageContext.session.new} 判断session ...pageContext.servletContext.serverInfo} 取得主机端的服务信息...
它是一种简单的语言,基于可用的命名空间(PageContext 属性)、嵌套属性和对集合、操作符(算术型、关系型和逻辑型)的访问符、映射到 Java 类中静态方法的可扩展函数以及一组隐式对象。 EL 提供了在 JSP 脚本编制...
并说出SessionBean和EntityBean的区别,StatefulBean和StatelessBean的区别。 EJB包括Session Bean、Entity Bean、Message Driven Bean,基于JNDI、RMI、JAT等技术实现。 SessionBean在J2EE应用程序中被用来完成...