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);
}
@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";
}
}
source
share