-
Learning spring
Hey everyone,
I started to learn spring mvc , i'm 2 days into it and I still cant figure out, how does it work(theres like too much info).I even dont know how to make a simple form and proccess the form's info. I know that it should work like codeIgniter in php, that the controller file controls the view file. Maybe i'm missing something?? What should I learn before learning spring?? I know a little jsp and servlets.
Heres one of my problems:
this is my Controller file:
Code:
public class HelloWorldController implements Controller {
public ModelAndView handleRequest(HttpServletRequest hsr, HttpServletResponse hsr1) throws Exception {
String aMessage = "tere tere";
ModelAndView md = new ModelAndView("welcome");
md.addObject("welcomeMessage", aMessage);
return md;
}
dispatcher-servlet.xml, there I added this line
Code:
<bean name="/welcome.htm" class="controller.HelloWorldController" />
And in the web-inf/jsp folder I have a welcome.jsp file with this line added
Code:
<h1>${welcomeMessage}</h1>
But when I deploy it and run it, then I get a
Code:
HTTP Status 404 -
type Status report
message
description The requested resource () is not available.
}[/CODE]
Sorry for my english!!!
-
Hi
this error occur when your path is not true, then you have to check file path that you link to it. like /welcome.htm and web-inf/jsp.
you can use from one IDE that support spring to link a file with CTRL+Space, i think you can use eclipse IDE with spring plugin :
http://www.eclipse-plugins.info/ecli...ils.jsp?id=506