reset password
Author Message
spanfer
Posts: 25
Posted 09:37 Jan 20, 2015 |

Hello,

I followed the steps 1 and 2 , when I try to run the application through eclipse I am getting 404 error, when I am requesting home.html.

Is anybody else getting 404 error when you run the application  through eclipse.

Thanks

lishenyu
Posts: 103
Posted 10:14 Jan 20, 2015 |

Look at your URL ,it's in a jsp folder ,so you have to create a jsp folder under WEB-INF ,then put the html under jsp folder

spanfer
Posts: 25
Posted 11:02 Jan 20, 2015 |

I did that still it doesnt work

cysun
Posts: 2935
Posted 11:48 Jan 20, 2015 |

There could be many reasons for a 404 error. First check the Console view in Eclipse and see if there's any error message there, then double check the code/file/directory etc. and see if they are exactly as described in the example. If it's on a laptop you can also bring it to my office hours.

spanfer
Posts: 25
Posted 15:42 Jan 20, 2015 |

 

 Thank you Professor. 

 To check I put an index.jsp under webapp (which is specified as a Welcome file) and it worked.

 It seems the front controller (Dispatcher Servlet) is not working. I am trying to add/enable logs to determine if the Dispatcher Servlet is running or if there are any issues because the mappings look correct (from *.html in web.xml to /home.html in HomeController).

Thanks

msargent
Posts: 519
Posted 09:51 Jan 21, 2015 |

Did you add any extra folders with the same name as one of the folders we're supposed to make? The reason I ask is that I incidentally added a folder with the same name as the folder with the controller, but in the wrong path (it was directly under src). Once I removed it everything worked.

dpatel34
Posts: 3
Posted 14:24 Jan 21, 2015 |

I follow all the required steps but at the end i got this error.

java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

cysun
Posts: 2935
Posted 15:52 Jan 21, 2015 |
dpatel34 wrote:

I follow all the required steps but at the end i got this error.

java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet

Check if you have the right dependency spring-webmvc. Also read this about fixing corrupted dependency.