• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Problems accessing ModelAttribute variable in JSP session.

 
Bartender
Posts: 1938
17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have a simple



in my Spring 3 MVC controller. I have put an Iterator there to make sure that the userService.loadUsers() is actually populated.

(The loadUsers() method returns a Set.)

----

Now, in my listUsers.jsp page, I have JSTL like this (to try to set up a combo with a list of user names):



----

The problem is that the combo is empty -- it never gets populated.

In the debugger, it steps right over the code and doesn't loop as it should.

Therefore, I think I'm missing something basic here.

Isn't the object automatically in the JSP's "session". Do I need to do something special to access it?

Look forward to any suggestions.

Thanks,

mike

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

First when you mentioned session you meant session scope. HTTPSESSION

--------------------------------------------------------------------------------------------
I got a problem with sessions in Spring I posted see below

"Thursday, June 23, 2011 7:22:09 PM by guillermo luque Title Session in Spring" Please give your opinon
about my post.
--------------------------------------------------------------------------------------------
If it is session scope let me tell you.

I was doing some research in sessions

let me ask a question

1.- I assume that you create the session before you run your jsp file and populated it
if you did you used HTTPSESSION or scope-sesion in the controller
if you use HTTPSESSION you need to carry over the session references over you application JSP does not carry over the session automatically when I was writing
app with servelet and jsp I put in all the JSP files


<jsp:useBean id="loginprocessor" class="com.luque.logged.beans.LoginProcessor" scope="application" />
<jsp:useBean id="userinfo" class="com.luque.logged.beans.UserInfo" scope="session" />

The session an application scope were created when the user sign in
But I was trying to use with spring and it did not work.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic