• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Define bean with Struts Tags in Request Scope

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

I have a problem, in JSP I have this tags to define a bean to Request scope
and take it in my Action class.


<bean efine id="copy_of_bean" name="actionForm" property="bean" toScope="request"/ type="mx.proj.package"/>

when i submit and redirect to ActionClass, in this i can�t see my object defined.

Are I doing anything wrong?
 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you say "submit" I'm assuming you mean that your jsp rendered, sent the html to the user and then the user submitted the html form back to the server. If thats the case then the problem is that this is a separate request from the one that the jsp was run in and everything the JSP put in its request scope has already been lost when the user submits the next html form.

Let me know if I made a bad assumption about what you meant by submit.
 
Vicente Ruiz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, your assumption is correct.

So if I want to obtain the bean in the Action, putting toScope="session" is the way, right?

Thank you very much!

Best regards.
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vicente Ruiz:

So if I want to obtain the bean in the Action, putting toScope="session" is the way, right?



Yes, you can do that and can retrieve the bean on Action or JSP page, as far as the session with the bean persists !
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic