struts2 注解例子
2015-03-24 15:55
267 查看
package com.joeyon.demo.component.action; import com.joeyon.framework.common.lang.Caster; import com.joeyon.framework.component.assembly.manager.AssemblyComponentManager; import com.joeyon.framework.util.CollectionUtils; import com.joeyon.framework.webutil.annotation.Action; import com.joeyon.framework.webutil.annotation.Result; import com.joeyon.demo.component.vo.ComponentVO; import com.joeyon.demo.framework.webutil.BaseAction; import java.util.List; @org.springframework.stereotype.Component("jfs.ComponentAction") @Action(className="jfs.ComponentAction") public class ComponentAction extends BaseAction { private ComponentModel model = new ComponentModel(); public Object getModel() { return this.model; } @Action(name="ComponentAction_goMain") @Result("/demo/pages/com/joeyon/demo/component/ComponentAction_goMain.jsp") public String goMain() { List allRegisterComponent = AssemblyComponentManager.getInstance().getAllRegisterComponent(); this.model.setListComponent(CollectionUtils.toList(allRegisterComponent, new Caster() { public ComponentVO cast(Object obj) { ComponentVO vo = new ComponentVO(); vo.setComponent((com.joeyon.framework.component.Component)obj); return vo; } })); return "success"; } @Action @Result("/demo/pages/com/joeyon/demo/component/ComponentAction_goDisplay.jsp") public String goDisplay() { ComponentVO vo = new ComponentVO(); vo.setComponent(AssemblyComponentManager.getInstance().getComponentByCode(this.model.getComponentCode())); this.model.setComponentVO(vo); return "success"; } }
相关文章推荐
- Struts 注解配置例子及redirect,redirectAction,chain的区别
- struts2.1.8+mybatis3.0+spring3.0(全注解)小例子
- Struts 注解配置例子及redirect,redirectAction,chain的区别
- Struts 注解配置例子及redirect,redirectAction,chain的区别
- 初学Struts 2创建一个Hello World例子(注解版)
- Struts 注解配置例子及redirect,redirectAction,chain的区别
- struts2.1.8+mybatis3.0+spring3.0(全注解)小例子
- Struts 注解配置例子及redirect,redirectAction,chain的区别
- Struts 注解配置例子及redirect,redirectAction,chain的区别
- 一个简单的Struts Hibernate入门例子(下)
- Struts2 注解配置 (struts.convention-plugn)
- Struts 2 + Spring2.5 + Hibernate3整合例子
- spring mvc注解例子
- hibernate+spring+struts例子
- struts中动态表单(DynaActionForm)的使用(超简单例子)
- Struts1 - 配置 - 说明详细且配合例子,简单易懂
- struts开发的最小功能实现例子总结
- struts 注解配置
- 仿spring的ioc实现之注解注入的小例子
- 编译时注解简单例子