Problem with Intellij spring mvc

I am using IntelliJ Ultimate version 13 and I have a problem with support for spring mvc controllers. I have several controllers in my code. I would suggest that they will be listed, shown in the spring toolbox. Then I could take a look at their path parameters, etc. I see some screenshots and it worked. I added support for spring for my project, but still the controllers are not visible to Intellij. Am I doing something wrong or is there a way to help Intellij correctly identify controllers? I am using spring 4 and java configuration approach. Best regards EDIT: Added controller example.

@Controller
public class HomeController extends AbstractBaseController {

    public static final String HOME_ID = "HOME";
    public static final String HOME_URL = "/";
    static Logger logger = LogManager.getLogger(HomeController.class);

    @Override
    protected void initializeRoutes() {
        routes.addRoute(HOME_ID, HOME_URL);
    }

    /**
     * Simply selects the home view to render by returning its name.
     */
    @RequestMapping(value = HOME_URL, method = RequestMethod.GET)
    public String home(Locale locale, Model model) {
        logger.warn("warn");
        Date date = new Date();
        DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
        String formattedDate = dateFormat.format(date);
        model.addAttribute("serverTime", formattedDate);
        return "home";
    }
}
+3
source share
1 answer

Add some properties to your project.

Project Structure->Facets->Click(+) and select spring facet from list and then point your module. 

, .

Settings->Ide settings->Plugins (browse repositories) and there you can search proper plugin.

.

0

All Articles