This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

There is any difference between the two code?

 
Yashnoo lyo
Ranch Hand
Posts: 152
  • 0
  • Mark post as helpful
  • send pies
  • 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:
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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:
 
Karthik Guru
Ranch Hand
Posts: 1209
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Struts forum.
bear
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic