i am already starting using Spring framework and already i came across some kind of stupid problem ( but in fact i can't solve it) I have controller which looks like:
package org.springframework.rest;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
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 SomeController {
@RequestMapping(value = "/", method = RequestMethod.GET)
@ResponseBody
public String returnHtmlPage() {
return "page";
}
}
where page is page.jsp:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>Home</title>
</head>
<body>
<h1>
Hello world!
</h1>
<P> The time on the server is ${serverTime}. </P>
</body>
</html>
but insteed of HTML file i have only string "page" returned. How can i fix the problem?
@ResponseBody:) So are you creating a REST service or a Web App?