package com.accp.bean.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import com.accp.bean.TestAInterface;
/**
* Servlet implementation class for Servlet: TestServlet
*
*/
public class TestServlet extends javax.servlet.http.HttpServlet {
static final long serialVersionUID = 1L;
/*
* (non-Java-doc)
*
* @see javax.servlet.http.HttpServlet#HttpServlet()
*/
public TestServlet() {
super();
}
/*
* (non-Java-doc)
*
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request,
* HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
this.doPost(request, response);
}
/*
* (non-Java-doc)
*
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request,
* HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
WebApplicationContext context = WebApplicationContextUtils
.getRequiredWebApplicationContext(this.getServletContext());
TestAInterface interface1 = (TestAInterface) context.getBean("testA");
response.getWriter().write(interface1.test2());
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
spring练习例子
共72个文件
class:15个
java:15个
xml:13个
4星 · 超过85%的资源 需积分: 10 94 下载量 185 浏览量
2008-04-15
22:36:38
上传
评论
收藏 3.79MB RAR 举报
温馨提示
spring例子spring例子spring例子spring例子
资源推荐
资源详情
资源评论
收起资源包目录
spring1.rar (72个子文件)
spring1
.project 1KB
.settings
org.eclipse.wst.common.component 402B
org.eclipse.jdt.core.prefs 330B
org.eclipse.wst.common.project.facet.core.xml 269B
org.eclipse.jst.common.project.facet.core.prefs 364B
src
log4j.properties 264B
com
accp
bean
TestB.java 215B
TestB2.java 193B
TestA2.java 433B
test
ProteTypeBean.java 150B
SingletonBean.java 144B
test1.xml 480B
Test2.java 1KB
action
TestAction.java 934B
TestForm.java 278B
TestA.java 524B
TestATest.java 589B
TestAInterface.java 100B
test.xml 680B
business
TestBusinessInterface.java 115B
TestBusiness.java 241B
servlet
TestServlet.java 2KB
TestBInteerface.java 99B
MessageResources.properties 1KB
build
classes
log4j.properties 264B
com
accp
bean
TestB2.class 533B
TestAInterface.class 162B
test
Test2.class 1KB
test1.xml 480B
ProteTypeBean.class 480B
SingletonBean.class 480B
action
TestForm.class 560B
TestAction.class 2KB
TestATest.class 1000B
TestBInteerface.class 147B
test.xml 680B
business
TestBusiness.class 460B
TestBusinessInterface.class 184B
servlet
TestServlet.class 2KB
TestA.class 858B
TestA2.class 744B
TestB.class 524B
MessageResources.properties 1KB
WebContent
test.jsp 386B
WEB-INF
struts-tiles.tld 8KB
validation.xml 631B
tiles-defs.xml 1KB
web.xml 3KB
struts-config.xml 805B
struts-bean.tld 9KB
test.xml 530B
struts-nested.tld 70KB
struts-html.tld 72KB
business.xml 371B
struts-logic.tld 14KB
validator-rules.xml 13KB
action-servlet.xml 432B
lib
commons-logging.jar 37KB
log4j-1.2.9.jar 344KB
commons-digester.jar 164KB
commons-logging-1.1.jar 52KB
commons-fileupload.jar 22KB
commons-beanutils.jar 184KB
struts.jar 537KB
commons-validator.jar 82KB
jakarta-oro.jar 64KB
commons-collections.jar 171KB
spring.jar 2.7MB
META-INF
MANIFEST.MF 39B
next.jsp 279B
.classpath 1KB
.amateras 226B
共 72 条
- 1
资源评论
- yang87305982012-05-02谢谢分享,只是运行的时候会有些问题,问题不大
- rayqq1234562012-08-07还可以 适合新手
- 为爱存在2014-05-07非常简单的那种小例子,基本上每个页面代码不超过10行的那种
erili
- 粉丝: 2
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功