01: /*
02: * JFox - The most lightweight Java EE Application Server!
03: * more details please visit http://www.huihoo.org/jfox or http://www.jfox.org.cn.
04: *
05: * JFox is licenced and re-distributable under GNU LGPL.
06: */
07: package org.jfox.petstore.action;
08:
09: import org.jfox.framework.annotation.Service;
10: import org.jfox.mvc.ActionContext;
11: import org.jfox.mvc.ActionSupport;
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 actionContext invocationContext
26: * @throws Exception exception
27: */
28: @ActionMethod(name="index",successView="index.vhtml",httpMethod=ActionMethod.HttpMethod.GET)
29: public void doGetIndex(ActionContext actionContext)
30: throws Exception {
31: PageContext pageContext = actionContext.getPageContext();
32: SessionContext sessionContext = actionContext
33: .getSessionContext();
34: /*
35: Account account = DAOSupport.newEntityObject(Account.class);
36: account.setFirstName("Yang Yong");
37: sessionContext.setAttribute("account", account);
38: */
39: pageContext.setAttribute("account", sessionContext
40: .getAttribute("account"));
41: }
42:
43: public static void main(String[] args) {
44:
45: }
46: }
|