系统原型结构描述(六)
2008-07-29 09:03
225 查看
globalMessages_en_US.properties
globalMessages_zh_CN.properties
HelloWorld = HelloWorld
FindEditAction_en_US.properties
FindEditAction_zh_CN.properties
Find.Title = Find
IndexEditProcessAction-validation.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="name">
<field-validator type="requiredstring">
<param name="trim">true</param>
<message>Please input name!</message>
</field-validator>
</field>
<field name="author">
<field-validator type="requiredstring">
<param name="trim">true</param>
<message>Please input author!</message>
</field-validator>
</field>
</validators>
DelEditProcessAction.java
package com.test.action.edit;
import com.opensymphony.xwork2.ActionSupport;
import com.test.logic.service.BookService;
public class DelEditProcessAction extends ActionSupport {
private BookService bookService = null;
public int id = 0;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public BookService getBookService() {
return bookService;
}
public void setBookService(BookService bookService) {
this.bookService = bookService;
}
public String execute() {
String result = ERROR;
if(id > 0) {
this.bookService.deleteBookById(id);
result = SUCCESS;
} else {
result = ERROR;
}
return result;
}
}
FindEditAction.java
package com.test.action.edit;
import com.opensymphony.xwork2.ActionSupport;
public class FindEditAction extends ActionSupport {
public String execute() {
return SUCCESS;
}
}
FindEditProcessAction.java
package com.test.action.edit;
import java.util.List;
import com.opensymphony.xwork2.ActionSupport;
import com.test.logic.service.BookService;
public class FindEditProcessAction extends ActionSupport {
private BookService bookService = null;
public String key = "";
public List list = null;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public BookService getBookService() {
return bookService;
}
public void setBookService(BookService bookService) {
this.bookService = bookService;
}
public String execute() {
String result = ERROR;
String tmp;
tmp = key.trim();
if(tmp.length() > 0) {
list = this.bookService.findBooks(key);
result = SUCCESS;
}
return result;
}
}
IndexEditAction.java
package com.test.action.edit;
import org.apache.log4j.Logger;
import com.opensymphony.xwork2.ActionSupport;
import com.test.domain.Book;
import com.test.logic.service.BookService;
public class IndexEditAction extends ActionSupport {
static Logger logger = Logger.getLogger(IndexEditAction.class);
private BookService bookService = null;
public int id = 0;
public String name = "";
public String author = "";
public String summary = "";
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public BookService getBookService() {
return bookService;
}
public void setBookService(BookService bookService) {
this.bookService = bookService;
}
public String execute() {
logger.debug("IndexEditAction executing ...");
logger.debug("id : " + id);
if(id > 0) {
Book book = this.bookService.getBookById(id);
if(book != null) {
this.id = book.getId();
this.name = book.getName();
this.author = book.getAuthor();
this.summary = book.getSummary();
}
}
return SUCCESS;
}
}
IndexEditProcessAction.java
package com.test.action.edit;
import com.opensymphony.xwork2.ActionSupport;
import com.test.domain.Book;
import com.test.logic.service.BookService;
public class IndexEditProcessAction extends ActionSupport {
private BookService bookService = null;
public int id = 0;
public String name = "";
public String author = "";
public String summary = "";
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public BookService getBookService() {
return bookService;
}
public void setBookService(BookService bookService) {
this.bookService = bookService;
}
public String execute() {
String result = ERROR;
Book book = new Book();
book.setId(id);
book.setName(name);
book.setAuthor(author);
book.setSummary(summary);
try {
this.bookService.save(book);
result = SUCCESS;
} catch (Exception e) {
e.printStackTrace();
result = ERROR;
}
return result;
}
}
globalMessages_zh_CN.properties
HelloWorld = HelloWorld
FindEditAction_en_US.properties
FindEditAction_zh_CN.properties
Find.Title = Find
IndexEditProcessAction-validation.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE validators PUBLIC
"-//OpenSymphony Group//XWork Validator 1.0.2//EN"
"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
<validators>
<field name="name">
<field-validator type="requiredstring">
<param name="trim">true</param>
<message>Please input name!</message>
</field-validator>
</field>
<field name="author">
<field-validator type="requiredstring">
<param name="trim">true</param>
<message>Please input author!</message>
</field-validator>
</field>
</validators>
DelEditProcessAction.java
package com.test.action.edit;
import com.opensymphony.xwork2.ActionSupport;
import com.test.logic.service.BookService;
public class DelEditProcessAction extends ActionSupport {
private BookService bookService = null;
public int id = 0;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public BookService getBookService() {
return bookService;
}
public void setBookService(BookService bookService) {
this.bookService = bookService;
}
public String execute() {
String result = ERROR;
if(id > 0) {
this.bookService.deleteBookById(id);
result = SUCCESS;
} else {
result = ERROR;
}
return result;
}
}
FindEditAction.java
package com.test.action.edit;
import com.opensymphony.xwork2.ActionSupport;
public class FindEditAction extends ActionSupport {
public String execute() {
return SUCCESS;
}
}
FindEditProcessAction.java
package com.test.action.edit;
import java.util.List;
import com.opensymphony.xwork2.ActionSupport;
import com.test.logic.service.BookService;
public class FindEditProcessAction extends ActionSupport {
private BookService bookService = null;
public String key = "";
public List list = null;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public BookService getBookService() {
return bookService;
}
public void setBookService(BookService bookService) {
this.bookService = bookService;
}
public String execute() {
String result = ERROR;
String tmp;
tmp = key.trim();
if(tmp.length() > 0) {
list = this.bookService.findBooks(key);
result = SUCCESS;
}
return result;
}
}
IndexEditAction.java
package com.test.action.edit;
import org.apache.log4j.Logger;
import com.opensymphony.xwork2.ActionSupport;
import com.test.domain.Book;
import com.test.logic.service.BookService;
public class IndexEditAction extends ActionSupport {
static Logger logger = Logger.getLogger(IndexEditAction.class);
private BookService bookService = null;
public int id = 0;
public String name = "";
public String author = "";
public String summary = "";
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public BookService getBookService() {
return bookService;
}
public void setBookService(BookService bookService) {
this.bookService = bookService;
}
public String execute() {
logger.debug("IndexEditAction executing ...");
logger.debug("id : " + id);
if(id > 0) {
Book book = this.bookService.getBookById(id);
if(book != null) {
this.id = book.getId();
this.name = book.getName();
this.author = book.getAuthor();
this.summary = book.getSummary();
}
}
return SUCCESS;
}
}
IndexEditProcessAction.java
package com.test.action.edit;
import com.opensymphony.xwork2.ActionSupport;
import com.test.domain.Book;
import com.test.logic.service.BookService;
public class IndexEditProcessAction extends ActionSupport {
private BookService bookService = null;
public int id = 0;
public String name = "";
public String author = "";
public String summary = "";
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getSummary() {
return summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public BookService getBookService() {
return bookService;
}
public void setBookService(BookService bookService) {
this.bookService = bookService;
}
public String execute() {
String result = ERROR;
Book book = new Book();
book.setId(id);
book.setName(name);
book.setAuthor(author);
book.setSummary(summary);
try {
this.bookService.save(book);
result = SUCCESS;
} catch (Exception e) {
e.printStackTrace();
result = ERROR;
}
return result;
}
}
相关文章推荐
- 系统原型结构描述(五)
- 系统原型结构描述(七)
- 系统原型结构描述(八)
- 系统原型结构描述(一)系统原型开发包目录结构清单
- 系统原型结构描述(九)
- 系统原型结构描述(二)系统原型开发包说明
- 系统原型结构描述(十)
- 系统原型结构描述(概述)最近要设计一个框架,大家一起讨论下如何实现?
- 系统原型结构描述(三)
- 系统原型结构描述(十一)
- 系统原型结构描述(四)
- 系统原型结构描述(十二)
- PowerDesigner(八)-面向对象模型(用例图,序列图,类图,生成Java源代码及Java源代码生成类图)面向对象模型 面向对象模型是利用UML(统一建模语言)的图形来描述系统结构的模型,
- 加载内核模块,实现新的系统调用:遍历系统当前所有进程的任务描述符,并将pid组织成树状结构显示
- 虚拟文件系统相关结构描述
- UML中如何描述系统的体系结构(二)
- UML中如何描述系统的体系结构(三)
- Linux下IP协议使用的地址描述数据结构结构的典型原型声明
- 虚拟文件系统相关结构描述【续】
- Neo.Geo系统视频硬件结构模拟 v2.0