Package com.fireflysource.demo.controller

Source Code of com.fireflysource.demo.controller.IndexController

package com.fireflysource.demo.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.firefly.annotation.Controller;
import com.firefly.annotation.PathVariable;
import com.firefly.annotation.RequestMapping;
import com.firefly.mvc.web.View;
import com.firefly.mvc.web.view.TemplateView;


@Controller
public class IndexController {
  @RequestMapping(value = "/index")
  public View index(HttpServletRequest request, HttpServletResponse response) {
    request.setAttribute("info", new String[]{"hello firefly", "test"});
    return new TemplateView("/index.html");
  }
 
  @RequestMapping(value = "/document/?/?")
  public View document(HttpServletRequest request, @PathVariable String[] args) {
    request.setAttribute("info", args);
    return new TemplateView("/index.html");
  }
}
TOP

Related Classes of com.fireflysource.demo.controller.IndexController

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.