0

enter image description here

when I was trying to add requestmapping annotation it got an error in the project .When I added import org.springframework.web.bind.annotation.RequestMapping;

got an another error.

package com.example.demo.controller.user;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller
@RequestMapping("Home")
public class HomeController {

}


1 Answer 1

2

Do you have the spring-web and spring-webmvc dependency mentioned in your pom.xml? If no then you have to add the same in pom.xml as dependencies.

You can refer the pom.xml from here: https://o7planning.org/en/10865/simple-crud-example-with-spring-mvc-restful-web-service

Sign up to request clarification or add additional context in comments.

1 Comment

when updated dependencies.It Worked.Happy learning.plz up quate my question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.