0

web application is made with gradle sts project i've added view Resolver like this

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
      <property name="prefix" value="/WEB-INF/view/" />
      <property name="suffix" value=".html" />
   </bean>

it is hitting the url but wont return any view

@Controller public class HomeController {

@RequestMapping(value = DatahubClientConstant.CLIENT_URL , method = RequestMethod.GET )
public ModelAndView getTestPage(HttpServletRequest request, HttpServletResponse response) throws Exception {
        //System.out.println("Hello World");
    return new ModelAndView("home");
}
}

Tried to sysout it works

It doesnt return any view?

Om Komawar
  • 251
  • 3
  • 19

1 Answers1

0

After Some Research i have found out that InternalViewResolver does not resolve html pages directly that's why i was not able to get the view.

Spring MVC ViewResolver not mapping to HTML files

This was a helpful question in resolving the issue. All it is doing is loading the html as static content.

Community
  • 1
  • 1
Om Komawar
  • 251
  • 3
  • 19