Do I understand this correctly? You have three commands: search, edit, and save. Upon successful save, you want to show the search page again.
How important is it that links are bookmarkable? You can do either a redirect or a forward. If you do a redirect you have to figure out how to "remember" the former values of the search clause, but the URLs will be accurate. I have a similar construct in one of my webapps, and I use the redirect approach because I'm pretty anal-retentive about sensible bookmarking. Instead of storing anything in the session I track the current state of the search form in persistent cookies. This has the added advantage that the user always returns to the same search state whenever they come back to the page, even across sessions. If you want to use a forward, I recommend creating a new model (appropriate to the search view) in your UseCaseSave controller and calling getCtx().setModel(). Then forward to the JSP. This is probably easier to do if you use FormBeanUser (or ThrowawayFormBeanUser). No, you don't need to know anything about Struts. Take a look at the friendbook-jsp-fbu sample application in the latest release. Jeff Schnitzer [EMAIL PROTECTED] > -----Original Message----- > From: DEO Kedar [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 01, 2003 12:55 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: [Mav-user] ThrowawayBean2 and session > > Hi, > > I am a new user of maverick. I have understood the friendbook-jsp example, > but I have the following problem... > > This is how my maverick.xml file looks like > > <command name="index"> > <view path="index.htm" /> > </command> > <command name="UCSearch"> > <controller class="com.uc.ctl.UseCaseSearch" /> > <view name="success" path="UCSearch.jsp" scope="session"/> > </command> > <command name="UseCase"> > <controller class="com.uc.ctl.UseCaseManage" /> > <view name="success" path="UseCase.jsp"/> > </command> > <command name="UCSave"> > <controller class="com.uc.ctl.UseCaseSave" /> > <view name="success" path="UCSearch.m"/> > </command> > > all the controller classes are extended from ThrowawayBean2. > > When I click a link on the index.htm file (href="UCSearch.m"), the > UCSearch.jsp page is displayed which has few text boxes and drop down as > filters for search. I have the logic in the perform() method of the > UseCaseSearch controller to populate the drop down. > Once I click search on the UCSearch page the page is submitted > (UCSearch.m). I have a hidden variable set to true, the controller in the > perform() reads the hidden variable and populates a collection of UseCase > objects. since its the same controller whatever filter criteria's I had > selected in the first place are displayed along with the search result. > Then I select a UseCase (UseCaseManage.m) and go to the UseCase.jsp page, > to edit a use case. On the edit page I have a save button, submits to > (UseCaseSave.m), the UseCaseSave controller saves the changed use case in > db. > The problem is returning back to the original search page after the save > and having the page remember the filter criterias. > If i have the maverick file as above <view name="success" > path="UCSearch.m"/> then it displays an error since the UseCaseSave > controller's getter's and setter's are not the same as of the > UseCaseSearch controller. Secondly, if I use type="redirect", then it > displays the page with empty text boxes, and also the url looks like > http://localhost:8080/uc/UCsave.m > > What is my workaround with this, to keep things in session. I have not > looked into the FormBeanUser controller. Is there a way to define the > formbean for a controller in the maverick.xml ? Can someone post a good > example using FormBeanUser controller along with how to setup the > maverick.xml file. > Is it necessary to know struts to learn the usage of FormBeanUser?? > > Thanks, > Deo > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 > [INVALID FOOTER] ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 [INVALID FOOTER]
