user2274060
user2274060

Reputation: 904

Spring annoting @RequestMapping does not exist

This is my code:

package com.application.myGoogleAppEngine.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;

@Controller
public class IndexController {

    @RequestMapping("/index")
    public String index(ModelMap map){
           return "index";
}
}

Unfornately, @RequestMapping makes an error. I use Spring 2.5.6 and I've imported org.springframework and org.springframework with spring-webmvc in my pom.xml

Do you have any solutions ?

Thank you

Upvotes: 0

Views: 301

Answers (1)

Sotirios Delimanolis
Sotirios Delimanolis

Reputation: 279910

Just add the import statement for that class

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

Upvotes: 1

Related Questions