/src/com/bosv/controller/Blog.java
Java | 55 lines | 27 code | 14 blank | 14 comment | 0 complexity | 8388f2b3895a446dab1da1facbdf8c4a MD5 | raw file
- /**
- * 文 件 名: Blog.java<br/>
- * 开发人员: @author Left<br/>
- * 邮 箱: <br/>
- * 系统名称: <br/>
- * 功能说明: <br/>
- * 开发时间: 2013-1-27上午1:41:21<br/>
- * 系统版本: @version 0.01<br/>
- * 版权信息: Copyright ? 2012-2013,bosv, All Rights Reserved<br/>
- * 修改记录: [M+修改顺序号 修改时间 修改人员 修改原因]<br/>
- *
- *
- */
- package com.bosv.controller;
- import java.util.HashMap;
- import org.apache.commons.logging.Log;
- import org.apache.commons.logging.LogFactory;
- import com.alibaba.fastjson.JSON;
- import com.bosv.web.Mapping;
- import com.bosv.web.renderer.Renderer;
- import com.bosv.web.renderer.TemplateRenderer;
- public class Blog {
-
- private final Log log = LogFactory.getLog(getClass());
-
- @Mapping("/hello")
- public String hello(){
- log.info("in hello");
- HashMap<String, String> hm = new HashMap<String, String>();
- hm.put("user", "left");
- hm.put("password", "12345");
-
-
-
- return JSON.toJSONString(hm);
- //return "<h1>hello,world!</h1>";
- }
-
- @Mapping("/hello/create/$1")
- public String hello(String name) {
- return "<h1>Hello, " + name + "</h1>";
- }
-
- @Mapping("/hello/show")
- public Renderer show(){
- return new TemplateRenderer("/jsp/index.jsp");
- }
- }