📄 getbooksaction.java
字号:
package com.ata.struts2;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
/**
* @author yeeku.H.lee kongyeeku@163.com
* @version 1.0
* <br>Copyright (C), 2005-2008, yeeku.H.Lee
* <br>This program is protected by copyright laws.
* <br>Program Name:
* <br>Date:
*/
public class GetBooksAction implements Action
{
private String[] books;
public void setBooks(String[] books)
{
this.books = books;
}
public String[] getBooks()
{
return books;
}
public String execute() throws Exception
{
String user = (String)ActionContext.getContext().getSession().get("user");
System.out.println(">>>user:>"+user);
if (user != null && user.equals("scott"))
{
BookService bs = new BookService();
setBooks(bs.getLeeBooks());
return SUCCESS;
}
else
{
return LOGIN;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -