Since the form you'd need to retrieve is named depending on the main page content, you won't know that information in the header (not easily anyway).
I mean, think of it this way... when your page is converted to a servlet, the header code is included in with the main page, and then the footer, so really you have one big chunk of code representing your page. The problem is that the CODE in the header doesn't know what page it's included in, and therefore doesn't inherently know the name of the form to retrieve. Remember that the includes are not done dynamically per request, they are done once when the JSP is converted to a servlet. (Caveat: I may be wrong about all this :) ) One approach would be that whatever Action your coming from, it should always stick the pages' form in request under some standard name (uhh, "form" strikes me as good?!?). That way, your header.jsp can always retrieve that known element and do whatever it needs to do. Alternatively, you could have a JSP variable in the main page that identifies the name of the actual form, and it's scope you'd probably need, and then be sure to include your header AFTER the point where the variables are declared, then your header should be able to access them since and use the information to retrieve the appropriate form. A third alternative, which I'm not sure will work (although I suspect it would) is to retrieve the ActionMapping of the page in the header. That should give you all the information you need to retrieve the form. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Wed, December 22, 2004 11:23 am, Dakota Jack said: > On Wed, 22 Dec 2004 14:59:04 -0000, Donie Kelly <[EMAIL PROTECTED]> > wrote: >> Hi all >> >> I have the following jsp layout for my pages >> >> Included header.jsp >> >> STRUTS PAGE >> >> Included footer.jsp >> >> Now in the header.jsp I have my site logo and I also want to add >> breadcrumbs. I want to establish and maintain a session throughout the >> app >> and if the session is invalid i want to redirect to the starting page so >> that I can initialise the app. I presume I need to put code in the >> header.jsp to handle this so no matter which page is accessed it can do >> these checks. >> >> I also want to access the ActionForm for the current page so that I can >> retrieve the page name to build up the breadcrumb. How can I do this? >> >> Any pointers would be appreciated. >> >> Donie >> > > > Call the form by its name in the scope where it exists. > > Jack > > ------------------------- > > "You can lead a horse to water but you cannot make it float on its back." > > ~Dakota Jack~ > > "You can't wake a person who is pretending to be asleep." > > ~Native Proverb~ > > "Each man is good in His sight. It is not necessary for eagles to be > crows." > > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ > > ----------------------------------------------- > > "This message may contain confidential and/or privileged information. > If you are not the addressee or authorized to receive this for the > addressee, you must not use, copy, disclose, or take any action based > on this message or any information herein. If you have received this > message in error, please advise the sender immediately by reply e-mail > and delete this message. Thank you for your cooperation." > > --------------------------------------------------------------------- > 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]