Package com.jverstry.Controller

Source Code of com.jverstry.Controller.MyController

package com.jverstry.Controller;

import com.jverstry.Data.SomeData;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class MyController {
 
  @RequestMapping(value = "/")
  public String home() {
    return "index";
  }
 
  @RequestMapping(value="/getJSON/{name}", method = RequestMethod.GET)
    public @ResponseBody SomeData getJSON(@PathVariable String name) {
       
    SomeData result = new SomeData(name, System.currentTimeMillis());
   
    return result;
   
   
 
}
TOP

Related Classes of com.jverstry.Controller.MyController

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.