Hello.
I have the dispatcher with config:
The JSP Page:Code:<mvc:default-servlet-handler/> <context:annotation-config/> <context:component-scan base-package="ru.ulmart.web.admin.controller"/> <bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean"> <property name="favorPathExtension" value="false" /> <property name="favorParameter" value="false" /> <property name="ignoreAcceptHeader" value="false" /> <property name="mediaTypes"> <value> json=application/json html=text/html </value> </property> </bean> <mvc:annotation-driven content-negotiation-manager="contentNegotiationManager"> <mvc:message-converters> <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> <property name="objectMapper" ref="jacksonObjectMapper"/> </bean> </mvc:message-converters> </mvc:annotation-driven> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> <property name="prefix"> <value>/WEB-INF/restpages/</value> </property> <property name="suffix"> <value>.jsp</value> </property> </bean>
and the controller:Code:<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Просмотр версии <c:out value="${versionNumber}"/> для объекта <c:out value="${objectName}"/></title> </head> <body> <c:out value="${objectData}"/> </body> </html>
But when i try to open: http://localhost:8080/web-admin/rest/version/view/8 i get the page as it is with put parsing any jsp tags:Code:@Controller @RequestMapping(value = "/rest") public class RESTController { @RequestMapping(value = "/version/view/{versionId}", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE) public String getViewVersionAsHTML(@PathVariable("versionId") String versionId, Model model, HttpServletRequest request, HttpServletResponse response) { String resultHTML = "versionview"; return resultHTML; } }
Code:<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>абаОбаМаОбб аВаЕббаИаИ <c:out value="${versionNumber}"/> аДаЛб аОаБбаЕаКбаА <c:out value="${objectName}"/></title> </head> <body> <c:out value="${objectData}"/> </body> </html>
What i do wrong?


Reply With Quote
