1

I am new to Spring MVC.

In my project I print the java object values in JSP using JSTL.

I assign the values in map object like below.

Map<String, Object> result =HashMap<String,Object>();

In Struts2 I get the java object value from ValueStack and print them in JSP using Struts2 tag.

My Questions are:

  1. Is there any ValueStack available in Spring MVC like it is in Struts2 ?
  2. If yes, which is its maximum capacity ?
  3. Which is the right language for displaying values to JSPin Spring MVC ?
Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
Selva
  • 1,620
  • 3
  • 33
  • 63

1 Answers1

2

I'm definitely not an expert of Spring MVC, but AFAIK there is nothing similar to a Value Stack;

Spring MVC is a standard Push-MVC framework: it pushes the values somewhere (session, request, model / modelMap, flashAttributes, etc...) and you retrieve them later by accessing the desired scope / object.

Struts2 instead is a Pull-MVC framework: it doesn't push anything in the request, in the session ecc... it instead stores everything in the Value Stack, making possible to pull out those values directly from the JSP. This was actually a great innovation and AFAIK there are not other frameworks like this among the most known ones. If you are not using Struts2 (no matter if Spring MVC or others), you generally need to push your stuff somewhere.

Since you don't have OGNL available in Spring MVC, you should also use JSTL with JSP EL, and Spring MVC Tags where availables (look for Spring’s Form Tag Library in that page)

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
  • 1
    Thanks,It's really helped me.But still i have one doubt,what is the maximum capacity of memory for request or session or valuestack or it is not limited?. – Selva Nov 04 '14 at 03:54