> -----Original Message----- > From: Leandro Melo [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 10, 2004 8:29 PM > To: struts jakarta > Subject: Re: Importing context with Struts > > > Well guys, > i'm just a beginner here, so i couldn't some points. > > I'll expose my situation in details, so maybe you show > me how to accomplish that... > > > Here's the base definition of my pages: > <definition name=".PartyPlace" > path="/layouts/layout.jsp"> > <put name="title" value="PartyPlace"/> > <put name="header" value="/common/header.jsp"/> > <put name="menu" value="/common/menu.jsp"/> > <!-- PLEASE, PAY ATTENTION TO THE ERROR TAG --> > <put name="error" > value="/functionalBlocks/errorHTMLcomponent.jsp"/> > <put name="pageComment" value="${pageComment}"/> > <put name="body" value="${body}"/> > <put name="footer" value="/common/footer.jsp"/> > </definition>
OKay... I have the exact same setup, and validation works just fine with this setup. The one thing I'm not doing is the ${name} that you are, but that shouldn't make a difference at all. WHat scope are your errors beign put in? That could be an issue. Here's my base layout: <definition name="mainLayout" path="/layout/layout2.jsp"> <put name="title" value="This is a title" /> <putList name="headerList"> <!-- Where the <html:errors/> tag is, the action itself grabs messages from the database, and forwards to a jsp page with the message list from the db and <html:errors/> on it. One of these days I'll break out into seperate JSPs :) --> <add value="/showMessages.do"/> </putList> <putList name="leftSideList"> <add value="/borrowerDemographics.jsp"/> <add value="/showPaymentHistory.do?detail=summary"/> </putList> <putList name="centerList"> <add value="/layout/body.jsp"/> </putList> <putList name="rightSideList"> <add value="/resources.jsp"/> <add value="/layout/links.jsp"/> <add value="/showDeferments.do"/> <add value="/showForebearances.do"/> </putList> <putList name="footerList"> <add value="/layout/footer.jsp"/> </putList> </definition> > > Here's the simple > /functionalBlocks/errorHTMLcomponent.jsp page: > <%@ taglib uri="/WEB-INF/struts-html.tld" > prefix="html"%> > <html:errors/> > > > I have a page for registering company data, wich is > part of the following definition: > <definition > name=".PartyPlace.RegisterCompanyCustomInfoReq" > extends=".PartyPlaceSideBar"> > <put name="body" > value="/register/registercompanycustominforeq.jsp"/> > <put name="pageComment" > value="/pageComments/registercompanycustominforeq_PAGECOMMENT.jsp"/> > <put name="sideBar" > value="/functionalSideBars/registercompany_SideBar.jsp"/> > </definition> > > > The registercompanycustominforeq.jsp page is the > following one: > <html:form action="/registercompanycustominforeq"> > <%@ include > file="/functionalBlocks/companyHTMLcomponent.jsf" %> > <%@ include > file="/functionalBlocks/buttonsHTMLcomponent.jsf" %> > > </html:form> > > > NOTE that the tag html:errors is not in > registercompanycustominforeq.jsp page, it's in the > errorHTMLcomponent.jsp page (as i showed). > When i submit a request the hits the validate method, > it comes back, but i cannot see the error because the > html:errors tag is in another page. > That's why i wanted to import the Struts context... > However, if there's a Tiles way to workaround that, > please, would you explain it to me? > Maybe with some code... > > Thank you very much, > ltcmelo > > > > > > > > -----Original Message----- > > > From: Michael McGrady > > [mailto:[EMAIL PROTECTED] > > > Sent: Tuesday, August 10, 2004 3:51 PM > > > To: Struts Users Mailing List > > > Subject: RE: Importing context with Struts > > > > > > > > > I thought that digester actually created classes > > out of this > > > stuff, Jim. No? > > > > Not quite.... the defintiion file gets turned into > > one java bean per definition. These java beans are > > then used to pull the parts together for the tags ( > > paraphrased from SIA Chap 11.1 pg 324). > > Since all jsp files are converted to a servlet > > first, then compiled, I would tend to say that all > > the jsps being declared in a tile definition being > > in the same class couldn't happen... however I can't > > seem to find out where websphere puts it's working > > stuff *SIGH* to verify this I can't say for sure. > > > > However, after digging through the tiles code I came > > across this: > > > http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org > /apache/struts/tiles/TilesUtilImpl.java?rev=1.9&view=markup > > The part that answers the question: > > public void doInclude( > > String uri, > > HttpServletRequest request, > > HttpServletResponse response, > > ServletContext servletContext) > > throws IOException, ServletException { > > > > > > request.getRequestDispatcher(uri).include(request, > > response); > > } > > Which means no..... all those jsp files are _NOT_ > > compiled into one big huge class..... they are > > individual servlets in keeping with the spec. > > > > > > > > > > At 03:23 PM 8/10/2004, you wrote: > > > > > > > > > > > -----Original Message----- > > > > > From: Michael McGrady > > [mailto:[EMAIL PROTECTED] > > > > > Sent: Tuesday, August 10, 2004 3:14 PM > > > > > To: Struts Users Mailing List > > > > > Subject: RE: Importing context with Struts > > > > > > > > > > > > > > > At 03:00 PM 8/10/2004, you wrote: > > > > > >Not class no, scope yes. > > > > > > > > > > The "extension" is not real? > > > > > > > >Humina? > > > >Let me try again: > > > >The following definition uses the session scoped > > bean > > > borrowerInformation > > > >in multiple jsp pages. Each of them seperate > > files, each of > > > them entirely > > > >unkowing of each other. All know > > borrowerInformation, for > > > it is in the > > > >session scope. Knowing borrowerInformation makes > > them happy. :) > > > > > > > ><definition name="mainLayout" > > path="/layout/layout2.jsp"> > > > > <put name="title" value="This is a > > title" /> > > > > <putList name="headerList"> > > > > <add value="/showMessages.do"/> > > > > </putList> > > > > <putList name="leftSideList"> > > > > <add > > value="/borrowerDemographics.jsp"/> > > > > <add > > value="/showPaymentHistory.do?detail=summary"/> > > > > </putList> > > > > <putList name="centerList"> > > > > <add value="/layout/body.jsp"/> > > > > </putList> > > > > <putList name="rightSideList"> > > > > <add value="/resources.jsp"/> > > > > <add value="/layout/links.jsp"/> > > > > <add > > value="/showDeferments.do"/> > > > > <add > > value="/showForebearances.do"/> > > > > </putList> > > > > <putList name="footerList"> > > > > <add > > value="/layout/footer.jsp"/> > > > > </putList> > > > > </definition> > > > > > > > > > > >--------------------------------------------------------------------- > > > >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] > > > > > > > > > > > ATTACHMENT part 15 message/rfc822 > > Para: [EMAIL PROTECTED] > > De: Vic Cekvenich <[EMAIL PROTECTED]> > > Assunto: Re: Importing context with Struts > > Data: Tue, 10 Aug 2004 19:51:38 -0500 > > > > You can get very dynamic w/ tiles, and use > > tilesaction for each tilee > > and put in scope what the tiles defnitions need to > > render, so each > > request is dynamycaly assembled. > > Rember that you can use tiles-el or el anywhere in > > servlet 2.4 > > > > (If you want to use extrnal or non "jsp" source, > > check out sitemesh) > > .V > > > > Leandro Melo wrote: > > > Suppose i got scattered pieces of code, wich > > includes > > > a lot of Struts tags. > > > These pieces are separate files, and i need to > > accesss > > > some struts attributes (or beans) from these other > > > files for each request. > > > > > > A nice example would be the html: error tag. In my > > > case, it's located outside of the file that > > contains > > > the submitted form, and i need to get the errors > > from > > > these other file (where the html: error tag is > > > located). That's why i need to import struts > > contexts > > > so i can get it done. > > > > > > Is there a way to do that? > > > > > > > > > > _______________________________________________________ > Yahoo! Acesso Grátis - navegue de graça com conexão de > qualidade! Acesse: http://br.acesso.yahoo.com/ > > --------------------------------------------------------------------- > 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]