• 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

There is any difference between the two code?

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone:
Have someone can tell me that there is any difference between the two code?
<action path="/saveRegiste" type="lyo.hotmail.bbs.RegisteAction" name="registeform" scope="request" input="registe">
If I change the scope to "scope="session" "
<action path="/saveRegiste" type="lyo.hotmail.bbs.RegisteAction" name="registeform" scope="session" input="registe">
They is any different effect when I run the jsp page? Thanks
:roll:
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your code is not a valid JSP, isn't it? I just would like to make sure what u expect from that code? What do u want to do with the scope?
Request scope is just for a particular request and will not be able to use to share the objects... But session scope is for all requests coming from the same client...
 
Yashnoo lyo
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you
You say that the code "<action path="/saveRegiste" type="lyo.hotmail.bbs.RegisteAction" name="registeform" scope="session" input="registe">" is wrong?
It is in my struts-config.xml. You means that it is can't share one Action object between different object in a struts application? :roll:
 
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Yashnoo lyo:
Hi everyone:
Have someone can tell me that there is any difference between the two code?
<action path="/saveRegiste" type="lyo.hotmail.bbs.RegisteAction" name="registeform" scope="request" input="registe">
If I change the scope to "scope="session" "
<action path="/saveRegiste" type="lyo.hotmail.bbs.RegisteAction" name="registeform" scope="session" input="registe">
They is any different effect when I run the jsp page? Thanks
:roll:


I dont think there is anythign wrong with this action mapping.
If you specify scope as "session" , struts will look for one such form in the session whenever you submit this JSP and hand it over to the corresponding action. If it had been request, it w'd be destroyed after you are done with the request and a new form will be created for every submit of the JSP. Do you really see a need to hold on to this form even after the request is completed?
 
Sheriff
Posts: 67746
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
Moving to Struts forum.
bear
 
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic