Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting No Mapping found error message

 
pramod talekar
Ranch Hand
Posts: 366
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Could you please tell me what is wrong with the following code :

This is the HelloController.class

Below is HelloWeb-servlet.xml :

Below is web.xml

This is hello.jsp in jsp folder


I get HTTP 404 error with the below message :

I tried out @RequestMapping("/") as well but getting the same error message.
Please advise.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wouldn't the URL be

{{WARName}}/Hello

This is always the place where everyone gets confused. I still do after years and years.

If you deploy on Tomcat or an App Server it typically maps the URL to the war file name unless you set it somewhere else.

Then you have to add the Servlet mapping, which in your case is just "/"

Then you add the RequestMapping which you have at the class level and is set to "/Hello"

Which if the war was called "mark.war" the the URL would be

localhost:8080/mark/Hello

Mark
 
pramod talekar
Ranch Hand
Posts: 366
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark.
I'll get back to you soon.

Regards,
Pramod
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic