Last active
February 17, 2016 06:16
-
-
Save tariq1890/02d5710971e1f07f427c to your computer and use it in GitHub Desktop.
Vamsi Gist
This file contains 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
class MovieController { | |
@RequestMapping(value = "/", method = RequestMethod.GET) | |
public String searchMovie(ModelMap model) { | |
String movieName="" | |
model.addAttribute("movieName", ""); | |
return "search"; | |
} | |
@RequestMapping(value = "/hello", method = RequestMethod.GET, produces = "application/json;charset=utf-8") | |
public @ResponseBody Object searchMovie() throws IOException { | |
List < MovieSearchResultObject > movieSearchResult = new ArrayList < MovieSearchResultObject > (); | |
try { | |
URL url = new URL("http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=9htuhtcb4ymusd73d4z6jxcj&q=avengers&page_limit=1"); | |
HttpURLConnection con = (HttpURLConnection) url.openConnection(); | |
con.setRequestMethod("GET"); | |
con.setRequestProperty("Accept", "application/json"); |
This file contains 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
<html> | |
<body> | |
<h2>Sign up for new semester please!</h2> | |
<form:form method="POST"> | |
<table> | |
<tr> | |
<td>Enter your Movie Name:</td> | |
<td><form:input path="movieName" /></td> | |
</tr> | |
<tr> | |
<td><input type="submit" name="submit" value="Submit"></td> | |
</tr> | |
<tr> | |
</table> | |
</form:form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment