Created
April 13, 2016 18:21
-
-
Save FreeFly19/cbd472d127673f6e4f7ad557291a0fad to your computer and use it in GitHub Desktop.
Vlad class work #12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
| import org.springframework.context.annotation.ComponentScan; | |
| import org.springframework.stereotype.Controller; | |
| import org.springframework.web.bind.annotation.RequestMapping; | |
| import org.springframework.web.bind.annotation.ResponseBody; | |
| import javax.servlet.http.HttpServletRequest; | |
| @EnableAutoConfiguration | |
| @Controller | |
| public class Application { | |
| String s=""; | |
| @RequestMapping("") | |
| @ResponseBody | |
| public String first(HttpServletRequest request) { | |
| if("true".equals(request.getParameter("clean"))) { | |
| s = ""; | |
| } | |
| String message = request.getParameter("message"); | |
| if(message !=null) { | |
| s += message + "<br>"; | |
| } | |
| return s + "Please enter some value" + | |
| "<form method=post action=/>" + | |
| "<input name=message>" + | |
| "<input type=submit value=Send>" + | |
| "</form>" + | |
| "<br>" + | |
| "<a href='?clean=true'>Clean</a>"; | |
| } | |
| public static void main(String[] args) { | |
| SpringApplication.run(Application.class); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment