Intelij says : Checks if Spring MVC View references are resolved correctly

Answered

 Hello!

I learn some study Spring MVC project but Intelij says : Checks if Spring MVC View references are resolved correctly.

It seems java code can't see jsp file placed in webapp although the correct path is described in WebMvcConfigurer and Spring facets are configured too.

The version of Intelij is 2017.3 Ultimate Edition. Pls give advice where to dig?

Thanks!

 

0
6 comments

Hello,

Have you tried the latest one (2018.3)? Is it possible to share your project for investigation?

 

0
Avatar
Permanently deleted user

Hello! Thanks for replay.

Yes, i downloaded 2018.3 but same situation. 

Link for project https://drive.google.com/open?id=1_D2dSUJM9W5vGdFIp7ZIW3RTwXDY651Y 

 

0
Avatar
Permanently deleted user

I changed  urlPath in addViewController  from "/login" to "/" .  The App opens login.jsp page now. But "login"  in  setViewName("login")  is still underlined.

@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/").setViewName("login");
}
0

We do not parse .prefix()/.suffix() calls yet: https://youtrack.jetbrains.com/issue/IDEA-186130

If you replace

registry.jsp().prefix("/WEB-INF/views/").suffix(".jsp");


with passing arguments directly in jsp() call it works:

registry.jsp("/WEB-INF/views/", ".jsp");
0
Avatar
Permanently deleted user

Yes, it worked! Thanks!

0

You are welcome!

0

Please sign in to leave a comment.