package com.testjsp.servlet;
import java.io.IOException;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.testjsp.factory.BizFactory;
import com.testjsp.pojo.Test;
public class TestAction extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doPost(request, response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String Action = request.getParameter("action");
if(Action.equals("show"))
{
List l = null;
try {
l = BizFactory.getBizImplInstance().QueryAll();
} catch (Exception e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
request.setAttribute("testList", l);
request.getRequestDispatcher("test.jsp").forward(request, response);
}else if(Action.equals("insert")){
String name = request.getParameter("name");
int age = Integer.parseInt(request.getParameter("age"));
String address = request.getParameter("address");
Test t = new Test();
t.setName(name);
t.setAge(age);
t.setAddress(address);
try {
BizFactory.getBizImplInstance().Insert(t);
} catch (Exception e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
//response.sendRedirect("TestAction?action=show");
}else if(Action.equals("del")){
int id = Integer.parseInt(request.getParameter("id"));
try {
BizFactory.getBizImplInstance().Delete(id);
} catch (Exception e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
//response.sendRedirect("TestAction?action=show");
}else if(Action.equals("modify")){
int id = Integer.parseInt(request.getParameter("id"));
String name = request.getParameter("name");
int age = Integer.parseInt(request.getParameter("age"));
String address = request.getParameter("address");
Test t = new Test();
t.setId(id);
t.setName(name);
t.setAge(age);
t.setAddress(address);
try {
BizFactory.getBizImplInstance().Update(t);
} catch (Exception e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
//response.sendRedirect("TestAction?action=show");
}else if(Action.equals("showXML")){
List l = null;
try {
l = BizFactory.getBizImplInstance().QueryAll();
} catch (Exception e) {
// TODO 自动生成 catch 块
e.printStackTrace();
}
request.setAttribute("testList", l);
request.getRequestDispatcher("testXML.jsp").forward(request, response);
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
flex的增删改查sample
共64个文件
java:10个
class:10个
swf:9个
3星 · 超过75%的资源 需积分: 10 369 下载量 93 浏览量
2009-01-05
12:46:03
上传
评论 4
收藏 2.58MB RAR 举报
温馨提示
flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,flex简单例子,
资源推荐
资源详情
资源评论
收起资源包目录
flex的增删改查.rar (64个子文件)
flex的增删改查
testFlex
.project 471B
testInfo.mxml 2KB
bin
test.html 4KB
testInfo.html 4KB
testFlex-debug.html 4KB
testInfo.swf 351KB
AC_OETags.js 8KB
history.js 1KB
test-debug.html 4KB
test.swf 501KB
testFlex.swf 113KB
playerProductInstall.swf 657B
testFlex.html 4KB
test-debug.swf 389KB
history.htm 1KB
history.swf 3KB
testFlex-debug.swf 179KB
.settings
com.adobe.flexbuilder.project.prefs 91B
org.eclipse.core.resources.prefs 88B
.actionScriptProperties 2KB
html-template
AC_OETags.js 8KB
history.js 1KB
index.template.html 4KB
playerProductInstall.swf 657B
history.htm 1KB
history.swf 3KB
test.mxml 3KB
.flexProperties 150B
testJSP
.project 1KB
.settings
org.eclipse.jdt.core.prefs 330B
.mymetadata 294B
WebRoot
css
style.css 626B
test.jsp 972B
WEB-INF
web.xml 1021B
lib
classes
com
testjsp
dao
ITest.class 312B
impl
TestImpl.class 3KB
servlet
TestAction.class 3KB
filter
EncodingFilter.class 1KB
service
IBiz.class 314B
impl
BizImpl.class 1011B
factory
SqlConFactory.class 999B
BizFactory.class 444B
DAOFactory.class 439B
pojo
Test.class 1KB
index.jsp 3KB
META-INF
MANIFEST.MF 39B
js
test.js 1KB
prototype.js 48KB
testXML.jsp 409B
2000-test
test_Data.MDF 1024KB
test_Log.LDF 1024KB
2005-db
test.mdf 3MB
test_log.ldf 1024KB
.myeclipse
src
com
testjsp
dao
impl
TestImpl.java 2KB
ITest.java 306B
servlet
TestAction.java 3KB
filter
EncodingFilter.java 766B
service
impl
BizImpl.java 636B
IBiz.java 309B
factory
DAOFactory.java 210B
SqlConFactory.java 656B
BizFactory.java 212B
pojo
Test.java 567B
.classpath 713B
共 64 条
- 1
kakukonrin
- 粉丝: 2
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- MATLAB 图像处理:自动检测黑白像素比例的多功能代码(支持灰度和二值图像)
- windows平台下终端工具-tabby
- STM32和ucosii系统温度监控系统keil5工程
- HIVE-14706.01.patch
- C# WInForm IrisSkin2皮肤控件
- svn cleanup 失败怎么办
- Spring Boot集成Spring Security,HTTP请求授权配置:包含匿名访问、允许访问、禁止访问配置
- 易语言-画曲线模块及应用例程
- 电子元件行业知名厂商官网(TI/NXP/ST/Infineon/ADI/Microchip/Qualcomm/Diodes/Panasonic/TDK/TE/Vishay/Molex等)数据样例
- Cytoscape-3-10-0-windows-64bit.exe
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页