|
Re: [xmlc] Headers and footers: msg#00003java.enhydra.xmlc
Hello Eric, I am currently using a dynamic header and footer. My approach is a little different but perhaps it will work for you. I'm using a custom framework but the premise is the same. All the pages in our site are passed to a handler that inspects the XMLObject for a particular div in this case <div id="header">. Sort of a "post processor" for the view where content that is the same across all pages gets added. Hope this helps. class RenderView{ // object that contains getters for the request and response. private HttpComs httpCom; ... public XMLCFactory getFactory(){ XMLCFactory factory = XMLCContext.getContext(httpCom.getServlet()).getXMLCFactory(); return factory; } public void drawheader(XMLObject returnHtml){ // Get the page containing the header and footer. headerFooterHTML headerFooter =(headerFooterHTML)this.getFactory().create(headerFooterHTML.class); ... Update the header content ... // Get the node in the return html where I want to insert the header. Import the header node // from the headerFooter. Append the node to the <div id="header"> element. Node node = returnHtml.getElementById("header"); if(node != null){ Node headerNode = returnHtml.importNode(headerFooter.getElementHeader(),true); node.appendChild(headerNode); } XMLCContext xmlc = XMLCContext.getContext(httpCom.getServlet()); OutputOptions outo = xmlc.createOutputOptions(httpCom.getRequest(), httpCom.getResponse(),returnHtml); outo.setPrettyPrinting(true); xmlc.writeDOM(httpCom.getRequest(), httpCom.getResponse(), outo ,returnHtml); } } Best regards James Rochford jrochford@xxxxxxxxx Erik Rasmussen wrote: I can only think of two ways to achieve common headers -- You receive this message as a subscriber of the xmlc@xxxxxxxxxxxxx mailing list. To unsubscribe: mailto:xmlc-unsubscribe@xxxxxxxxxxxxx For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [xmlc] Headers and footers, Erik Rasmussen |
|---|---|
| Next by Date: | Re: [xmlc] Headers and footers, Erik Rasmussen |
| Previous by Thread: | [xmlc] Headers and footers, Erik Rasmussen |
| Next by Thread: | Re: [xmlc] Headers and footers, Erik Rasmussen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |