私は高度なJavaとSpringフレームワークの学習の初心者です。チュートリアルを 1 つ見つけました
http://netbeans.org/kb/docs/web/quickstart-webapps-spring.html
以下のコードで
package contoller;
import java.net.BindException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.portlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;
import service.HelloService;
/**
*
* @author Manish
*/
public class HelloController extends SimpleFormController {
public HelloController() {
setCommandClass(Name.class);
setCommandName("name");
setSuccessView("helloView");
setFormView("nameView");
}
private HelloService helloService;
public void setHelloService(HelloService helloService) {
this.helloService = helloService;
}
@Override // Error Method does not override or implment a method of supertype
protected ModelAndView onSubmit(
HttpServletRequest request,
HttpServletResponse response,
Object command,
BindException errors) throws Exception {
Name name = (Name) command;
ModelAndView mv = new ModelAndView(getSuccessView());
mv.addObject("helloMessage", helloService.sayHello(name.getValue()));
return mv;
}
この問題を解決するにはどうすればよいですか?
よろしく。