ModelAttributes options not available on jsp

Created a new MVC Spring project using MAven and Im having a problem when modelAttributes attributes are not replaced on the jsp page. For instance,

<%@ page session="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html" %>

Hello Worlds ${location} is ${weathers}
<c:out value="${location}"/>

displays

Hello Worlds ${location} is ${weathers}
${location}

instead

Hello Worlds Omaha is Cold
Omaha

I assume that I am missing a jar, I have a list in the mvn dependency list:

   <dependency>
       <groupId>taglibs</groupId>
       <artifactId>standard</artifactId>
       <version>1.1.2</version>
   </dependency>
   <dependency>
       <groupId>org.apache.geronimo.specs</groupId>
       <artifactId>geronimo-servlet_2.4_spec</artifactId>
       <version>1.1.1</version>
   </dependency>
   <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
       <version>2.4</version>
       <scope>provided</scope>
   </dependency>
   <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring</artifactId>
       <version>2.0.7</version>
   </dependency>
   <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-webmvc</artifactId>
       <version>2.5.5</version>
   </dependency>
+1
source share
2 answers

I quote from the answer that I predetermined before the EL problem not working:

In other words, the expression EL is not evaluated? This may have one or more of the following reasons:

  • The application server in question does not support JSP 2.0.
  • web.xml not declared as Servlet 2.4 or higher.
  • @pageconfigured using isELIgnored=true.
  • Web.xml <el-ignored>true</el-ignored> <jsp-config>.

1) . 3) 4) , , . 2). web.xml, -, . , web.xml Servlet 2.4:

<web-app
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

    <!-- Here you go. -->

</web-app>
+4

, JSP pre-2.0, EL. , .

, :

<%@ page isELIgnored="false" %>
+3

Source: https://habr.com/ru/post/1740183/


All Articles