• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

access session scope variables in jsp

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have an application in Springs.I have a variable set in the Map in my controller which is in session. I need to use that variable in my jsp using the jstl tags so that i can access it from session scope in multiple jsps.

Can anyone provide me the tag with syntax that can be used to achieve the required thing.

Thanks in advance.

Regards,
Paresh.
 
Sheriff
Posts: 67645
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You reference any scoped variable, in the session or the other scopes, by simply naming it in an EL expression.

For example:
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a small point to add for Bear statement,

I have a variable set in the Map in my controller which is in session. I need to use that variable in my jsp



As you have said the variable is in a Map which is in the session,

you need to access using ${mapName.keyName} or ${mapName["keyName"]}

thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic