MyMVC Web结构的开发形式

[代码] 控制器代码 package com.wuwei.controller;

import java.util.List;

import org.marker.mvc.controller.Controller;
import org.marker.mvc.controller.an.Before;
import org.marker.mvc.controller.an.Namespace http://www.haokk123.info/linked/20130424.do ;
import org.marker.mvc.controller.an.Result;
import org.marker.mvc.controller.an.Results;
import org.marker.mvc.controller.intercept.UniqueConnection;
import org.marker.mvc.model.engine.IME;
import org.marker.mvc.model.engine.ModelEngine;
import org.marker.mvc.view.render.RenderType;



/**
 * MyMVC Demo 
 * 访问地址为:http://ip:端口/命名空间/方法称谓.do 
 * @author marker
 * */
@Namespace("/test/")
@Results({//视图集
	@Result(name="hello",type=RenderType.JSP,to="hello.jsp"),
	@Result(name="userlist",type=RenderType.JSP,to="user.jsp"),
})
@Before(UniqueConnection.class)//仅有数据库联接拦截器
public class IndexController extends Controller {
 
	private static final long serialVersionUID = -409300377022252007L;
	
	//数据库操作引擎
	private IME dao = ModelEngine.me();
	 
	
	//HelloMyMVC
	public String index(){
		put("msg", "hello MyMVC! "); 
		return "hello";
	} 
	
	/** 闪现用户  */
	public String user(){ 
		List
posted @ 2013-04-25 05:36  chinadiy197601  阅读(227)  评论(0编辑  收藏  举报