- getServletContext() 是获取web.xml中 <context-param> 配置的参数
- getServletConfig() 是获取web.xml 中 <servlet>中<init-param> 配置的参数
- ServletConfig对象拥有对ServletContext对象的引用,所以可以通过
getServletConfig().getServletContext()来获取ServletContext对象
- ServletContext对象应用于整个web app,而ServletContext只应用于当前Servlet
- 浏览: 46951 次
最新评论
【servlet】 getServletConfig() 与 getServletContext() 的区别
- 博客分类:
- servlet
相关推荐
Called by the servlet container to indicate to a servlet that the servlet is being taken out of service. destroy() - Method in class javax.servlet.GenericServlet Called by the servlet container to ...
out.print(this.getClass() + this.getServletConfig().getServletContext().getInitParameter("a")); out.println(", using the GET method"); out.println(" </BODY>"); out.println("</HTML>"); out....
out.print(this.getClass() + this.getServletConfig().getServletContext().getInitParameter("a")); out.println(", using the GET method"); out.println(" </BODY>"); out.println("</HTML>"); out....
out.print(this.getClass() + this.getServletConfig().getServletContext().getInitParameter("a")); out.println(", using the GET method"); out.println(" </BODY>"); out.println("</HTML>"); ...
185、getServletContext()和getServletConfig()的意思 44 186、Hashtable和HashMap 44 187、JAVA SERVLET API中forward() 与redirect()的区别? 44 189、Can a Java Thread be started from Servlet class, and what...
185、getServletContext()和getServletConfig()的意思 44 186、Hashtable和HashMap 44 187、JAVA SERVLET API中forward() 与redirect()的区别? 44 189、Can a Java Thread be started from Servlet class, and what...
su.initialize(getServletConfig(), request, response); // 5:上传 su.upload(); // 拿取Smartupload的request // 注意当我们使用了SmartUpload此jar包后 // 无法再次使用httpServletRequest这...
7 ServletConfig getServletConfig() 返回当前页的ServletConfig对象(config) 8 ServletContext getServletContext() 返回当前页的ServletContext对象(application) 9 void setAttribute(String name,Object ...
FlexContext.getServletConfig().getServletContext() ); String beanName = getSource(); try { log.info("Lookup bean from Spring ApplicationContext: " + beanName); return appContext.getBean(bean...
FlexContext.getServletConfig().getServletContext() ); String beanName = getSource(); try { log.info("Lookup bean from Spring ApplicationContext: " + beanName); return appContext.getBean...