aspose file tools*
The moose likes Struts and the fly likes There is any difference between the two code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "There is any difference between the two code?" Watch "There is any difference between the two code?" New topic
Author

There is any difference between the two code?

Yashnoo lyo
Ranch Hand

Joined: Feb 17, 2003
Posts: 152
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:


When I face C# and Java I choose Java.
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
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...


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Yashnoo lyo
Ranch Hand

Joined: Feb 17, 2003
Posts: 152
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

Joined: Mar 06, 2001
Posts: 1209
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

Joined: Jan 10, 2002
Posts: 61010
    
  65

Moving to Struts forum.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: There is any difference between the two code?