Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

store variables in a jsp page scope with the spring framework

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to store variables in the jsp page scope with the spring 2.5.x framework?

This has compile errors.
What is the proper way to initialize pageContext?


Description Resource Path Location Type
The local variable pageContext may not have been initialized HwController.java /com.mycompany.monitoring.war/src/com/mycompany/monitoring/war line 59 Java Problem


 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just a request attribute? Or put it in the ModelAndView, which is probably more appropriate if you're using SpringMVC anyway.
 
albert kao
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

David Newton wrote:Why not just a request attribute? Or put it in the ModelAndView, which is probably more appropriate if you're using SpringMVC anyway.



I want to store some variables (e.g. number of rows per table) at page scope in Spring so that each page has its own group of variables. What is the proper way to do that? My approach of using the PageContext for that purpose may or may not be wrong.
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic