Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Library.java~21~
Package: LibraryManage.rar [view]
Upload User: toby828
Upload Date: 2015-06-26
Package Size: 8558k
Code Size: 2k
Category:
Jsp/Servlet
Development Platform:
Java
- package com.action;
- import org.apache.struts.action.ActionMapping;
- import org.apache.struts.action.ActionForm;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import org.apache.struts.action.ActionForward;
- import com.dao.LibraryDAO;
- import com.actionForm.LibraryForm;
- import org.apache.struts.action.Action;
- public class Library extends Action {
- LibraryDAO libraryDAO=null;
- public Library(){
- libraryDAO=new LibraryDAO();
- }
- public ActionForward perform(ActionMapping mapping, ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response) {
- LibraryForm libraryForm=(LibraryForm) form;
- String str=request.getParameter("action");
- if("libraryQuery".equals(str)){
- return libraryModifyQuery(mapping,form,request,response);
- }else if("libraryModify".equals(str)){
- return libraryModify(mapping,form,request,response);
- }
- return mapping.findForward("error");
- }
- private ActionForward libraryModify(ActionMapping mapping, ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response
- ){
- LibraryForm libraryForm = (LibraryForm) form;
- libraryForm.setId(libraryForm.getId());
- libraryForm.setLibraryname(libraryForm.getLibraryname());
- libraryForm.setCurator(libraryForm.getCurator());
- libraryForm.setTel(libraryForm.getTel());
- libraryForm.setAddress(libraryForm.getAddress());
- libraryForm.setEmail(libraryForm.getEmail());
- libraryForm.setUrl(libraryForm.getUrl());
- libraryForm.setCreateDate(libraryForm.getCreateDate());
- libraryForm.setIntroduce(libraryForm.getIntroduce());
- int ret = libraryDAO.update(libraryForm);
- if (ret == 0) {
- request.setAttribute("error", "图书馆信息修改失败!");
- return mapping.findForward("error");
- } else {
- return mapping.findForward("librarymodify");
- }
- }
- private ActionForward libraryModifyQuery(ActionMapping mapping, ActionForm form,
- HttpServletRequest request,
- HttpServletResponse response
- ){
- return mapping.findForward("librarymodify");
- }
- }