spring CONTROLLER cannot be included

Viewed 27
package com.mybatis.control;

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

import org.springframework.stereotype.Controller 

public class Controller {

    @RequestMapping
    public String test() {
        return("test");
    }
}

At line 3 I need to add a @Controller annotation, but I am unable to add. Rather than I am getting a stereotype.

1 Answers

yes its correct

@Component, @Service, @Controller, @Repository 

are available in

org.springframework.stereotype

package.

Related