java - JSTL variables not being displayed -


I am doing some spring tutorials and have failed in both stages where the scene has printed the variable using JSTL is. / P>

View:

  & lt;% @ page content type = "text / html" page encoding = "UTF-8"%> & Lt;% @ include file = "/ WEB-INF / jsp / include.jsp"%> & Lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Head & gt; & Lt; Title & gt; & Lt; Fmt: message key = "title" /> & Lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; H1 & gt; & Lt; Fmt: message key = "heading" /> & Lt; / H1> & Lt; P & gt; & Lt; Fmt: message key = "greeting" /> & Lt; C: out value = "$ {model.now}" /> gt; & Lt; / P & gt; & Lt; H3 & gt; Product & lt; / H3 & gt; & Lt; C: forEach item = "$ {model.products}" var = "prod" & gt; & Lt; C: out value = "$ {prod.name}" /> & Lt; I & gt; $ & Lt; C: out value = "$ {prod.number}" /> & Lt; / I & gt; & Lt; Br> & Lt; Br> & Lt; / C: foreach & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

FMT: Message Parts are displayed correctly on my page, but not being part of $ {model.now}.

"Hello.jsp" on the above page, which contains "include.jsp", which includes the following:

  tagline prefix = "c" uri = "http : //java.sun.com/jsp/jstl/core "JSTL is in my libraries folder (I am using Netbeans)  

/ P>

Does anyone know why this is happening and nothing is given at all?

Here is the controller:

  Public Model and Visual Code (HTTP Provincial Request Request, HTTPServlet Response Response) throws Servicelate Passage, IOException {string now = (new java.util .Date ()) ToString (); Logger.info ("Hello now with Returning view"); Maps & lt; String, Object & gt; MyModel = new Hashmap & lt; String, Object & gt; (); MyModel.put ("now", now); MyModel.put ("Products", this.productManager.getProducts ()); Return the new modelAndrewview ("Hello", "Model", MyMold); }  

web.xml:

  & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Web-app version = "2.5" xmlns = "http://java.sun.com/xml/ns/javaee" xmlns: xsi = "http://www.w3.org/2001/XMLSchema -instance" Si: Schema Location = "http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> & Lt; Context param & gt; & Lt; Ultimate Name & gt; ContextConfigLocation & lt; / Lastname & gt; & Lt; Ultimate Price & gt; /WEB-INF/applicationContext.xml< / Super-valued & gt; & Lt; / Reference param & gt; & Lt; Listener & gt; & Lt; Audience & gt; Org.springframework.web.context.ContextLoaderListener & lt; / Audience & gt; & Lt; / Listener & gt; & Lt; Servlet & gt; & Lt; Servlet-name & gt; Springapp & lt; / Servlet-name & gt; & Lt; Servlet category & gt; Org.springframework.web.servlet.DispatcherServlet & lt; / Servlet category & gt; & Lt; Load-On-Startup & gt; 1 & lt; / Load-on-startup & gt; & Lt; / Servlet & gt; & Lt; Servlet-mapping & gt; & Lt; Servlet-name & gt; Springapp & lt; / Servlet-name & gt; & Lt; URL pattern & gt; * Htm & Lt; / Url pattern & gt; & Lt; / Servlet-mapping & gt; & Lt; Session-config & gt; & Lt; Session timeout & gt; 30 & lt; / Session-timeout & gt; & Lt; / Session-config & gt; & Lt; Welcome-file-list & gt; & Lt; Welcome-file & gt; Index.jsp & lt; / Welcome-file & gt; & Lt; / Welcome-file-list & gt; & Lt; / Web application & gt;  

Successfully discovered why this was not working:

I was mapping my hello view in my web site wrongly, this page was loading but was not loading the model correctly, so why no variable was displayed

< / Div>

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -