KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > petstore > action > PageAction


1 /*
2  * JFox - The most lightweight Java EE Application Server!
3  * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
4  *
5  * JFox is licenced and re-distributable under GNU LGPL.
6  */

7 package org.jfox.petstore.action;
8
9 import org.jfox.framework.annotation.Service;
10 import org.jfox.mvc.ActionSupport;
11 import org.jfox.mvc.InvocationContext;
12 import org.jfox.mvc.PageContext;
13 import org.jfox.mvc.SessionContext;
14 import org.jfox.mvc.annotation.ActionMethod;
15
16 /**
17  * @author <a HREF="mailto:jfox.young@gmail.com">Young Yang</a>
18  */

19 @Service(id = "page")
20 public class PageAction extends ActionSupport {
21
22     /**
23      * index page
24      *
25      * @param invocationContext invocationContext
26      * @throws Exception exception
27      */

28     @ActionMethod(successView = "index.vhtml")
29     public void doGetIndex(InvocationContext invocationContext) throws Exception JavaDoc {
30         PageContext pageContext = invocationContext.getPageContext();
31         SessionContext sessionContext = invocationContext.getSessionContext();
32 /*
33         Account account = DAOSupport.newEntityObject(Account.class);
34         account.setFirstName("Yang Yong");
35         sessionContext.setAttribute("account", account);
36 */

37         pageContext.setAttribute("account", sessionContext.getAttribute("account"));
38     }
39
40     public static void main(String JavaDoc[] args) {
41
42     }
43 }
44
Popular Tags