The value of Modelandview AddObject () setting in Springmvc JSP is not being taken

Source: Internet
Author: User

This problem occurs because of the old JSP 1.2 declaration.

If you use the jsp1.2 version of Web. XML, the DTD is defined as follows

<! DOCTYPE Web-app Public

"-//sun Microsystems, INC.//DTD Web application 2.3//en"

"Http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>

//...

</web-app>

El is off by default ... Must be opened manually. <%@ page iselignored= "false"%>

This method must add a directive <%@ page iselignored= "false" on each page%>

Another workaround is to modify the Web. xml file as follows

<?xml version= "1.0" encoding= "UTF-8"?>

<web-app version= "2.5"

Xmlns= "Http://java.sun.com/xml/ns/javaee"

Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"

Xsi:schemalocation= "Http://java.sun.com/xml/ns/javaee

Http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd ">

<display-name>SpringMVC</display-name>

<servlet>

<servlet-name>hello</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>hello</servlet-name>

<url-pattern>/</url-pattern>

</servlet-mapping>

</web-app>




The value of Modelandview AddObject () setting in Springmvc JSP is not being taken

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.