⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timeservlet.java

📁 spring2.0技术手册随书事例,结合例子学习起来更轻松
💻 JAVA
字号:
package onlyfun.caterpillar;
 
import java.io.*; 
import javax.servlet.*; 
import javax.servlet.http.*; 
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.
                                support.WebApplicationContextUtils;
 
public class TimeServlet extends HttpServlet { 
    public void doGet(HttpServletRequest req, 
                    HttpServletResponse res) 
                  throws ServletException, IOException { 
        WebApplicationContext ctx = 
                WebApplicationContextUtils.
                    getRequiredWebApplicationContext(
                        this.getServletContext());
        
        PrintWriter out = res.getWriter(); 
        out.println(ctx.getBean("dateBean")); 
    } 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -