I'm not sure I fully understand what you're trying to do, but it seems like there is 
some confusion over the request scope and how long it lasts.  Your first request scope 
ends once index.jsp loads; if you want to use the junkbean again after that, you have 
to save it again, either in the new request or in the session (or possibly other 
places, but those are the 2 most obvious).  So LogonAction would only be able to get 
junkbean from the request if index.jsp put it there (again).

:-> -----Original Message-----
:-> From: Andy Engle [mailto:[EMAIL PROTECTED]
:-> Sent: Thursday, March 04, 2004 5:13 PM
:-> To: Struts Users Mailing List
:-> Subject: Re: Returning fully-stocked Actions/JSPs from other Actions
:-> 
:-> 
:-> Michael McGrady wrote:
:-> 
:-> > I am having a hard time seeing what you want to do, but I 
:-> know that
:-> > your issues with the "junkbean" are unrelated to the 
:-> "hiding" of the
:-> > JSPs behind/beneath/be-whatever WEB-INF.  If you want to 
:-> access data,
:-> > including an object, then the data must be saved 
:-> somewhere and then
:-> > accessed where it is saved during the time it is saved.  
:-> That is the
:-> > simple truth that is required for this situation.
:-> 
:-> Sure -- that's the only way it will work.  I'll try to put 
:-> everything
:-> in order here, as I am doing it:
:-> 
:-> 1. IndexAction (mapped to /home.do) puts data into the bean:
:-> 
:->         List users = service.viewAllPeople(birForm);
:->         request.setAttribute("junkbean", users);
:-> 
:->     ...and then returns index.jsp:
:-> 
:->         <forward name="continue" path="/WEB-INF/pages/index.jsp"/>
:-> 
:-> 2. Within this index.jsp is a form, which is submitted to 
:-> LoginAction.
:-> 
:-> 3. When I submit the form to LoginAction and LoginAction is 
:-> finished,
:-> then I want to return the /home.do mapping, or display the index.jsp
:-> screen again:
:-> 
:->         <action
:->             path="/login"
:->             type="com.andyengle.actions.LogonAction"
:->             name="logonForm"
:->             scope="request"
:->             input="/WEB-INF/pages/index.jsp">
:->           <forward name="continue" path="/home.do"/>
:->         </action>
:-> 
:-> 4. When I do this, I get the following error:
:-> 
:->     Cannot find bean junkbean in any scope
:-> 
:-> 
:-> > If you go to access it and it is not there, then you must be
:-> > accessing in session scope and saving in request scope or 
:-> something
:-> > like that.
:-> 
:-> Ok, in IndexAction, I did put it in request scope, but that 
:-> should work
:-> because I only want it for this request, not necessarily 
:-> for the entire
:-> session.  But in this case, does IndexAction even have access to the
:-> request scope, or does LoginAction only have access to that (i.e.
:-> IndexAction can't put junkbean in request scope)?
:-> 
:-> 
:-> > You need to ask: (1) did I save "junk bean"?
:-> 
:-> Yes.
:-> 
:-> 
:-> > (2) If not, do so.  If so, then is the scope of the respository
:-> > adequate for your purposes.
:-> 
:-> It seems that request scope should be adaquate in this case, since I
:-> only need it for the current request.
:-> 
:-> 
:-> > (3) Etc. Okay dokay?
:-> 
:-> Okay dokay -- thanks!  Let me know if that is a decent-enough
:-> clarification of my earlier question.
:-> 
:-> 
:-> Andy
:-> 
:-> 
:-> ------------------------------------------------------------
:-> ---------
:-> To unsubscribe, e-mail: [EMAIL PROTECTED]
:-> For additional commands, e-mail: [EMAIL PROTECTED]
:-> 
:-> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to