import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import com.chinova.desk.service.AppService;
@Controller
public class TestController {
@Autowired
private AppService appService;
private static int i;
/**
*
*/
public TestController() {
System.out.println("1 --- " + i++);
}
@RequestMapping("/1")
public String test(){
return "word-extend-list";
}
@RequestMapping("/2")
public void test2(HttpServletResponse response) throws IOException{
PrintWriter pw = response.getWriter();
pw.println("ok");
}
@RequestMapping("/3")
public void test3(HttpServletResponse response) throws IOException{
response.setStatus(500);
PrintWriter pw = response.getWriter();
pw.println("ok");
}
@RequestMapping("/4")
public String test4(@RequestParam(required = false,value = "person_name") String name,@RequestParam(required = true) String body) throws IOException{
System.out.println(name);
System.out.println("11111111111111 " + appService);
return "login";
}
@RequestMapping("/5")
public String test5(){
return "/main/word-extend-list";
}
@RequestMapping("/6")
public String test6(){
return "/word-extend-save";
}
@RequestMapping("/7")
public String test7(){
return "/search-query-create";
}
}