1
I have a Spring MVC project that will provide the Rest service to the front-end.
But when creating a page . html the project does not recognize it and always from 404. Is there any configuration I should do for spring mvc to recognize . html?
Servlet-context.xml file:
<beans:bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" /> /*ja mudei para .html mas não funcionou*/
</beans:bean>
And the web.xml file:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Why the Pattern URL on
web.xml
is with only one "/" ?– Julian
Set as what the controller is calling this page.
– Sidney
Hello, in which folder is your HTML views?
– Leonardo Villela