RE: context variable in xsl
"Schnitzer, Jeff" <[email protected]>
| Newsgroups | gmane.comp.web.maverick.general |
|---|---|
| Message-ID | <[email protected]> |
Well, my usual habit is to make all links relative. If you can't do that, there are a couple options: If you are using ThrowawayBean-style controllers and they all inherit from a common base class, add a getContext() property to the base. This will propagate into the model everywhere... so it will be <xsl:value-of select="/model/context"/> You can provide the context to all transforms as a param. Right now this would require transforming the config file with an XSL that adds a <param> node to all <transform> nodes. Then you can access it like: <xsl:value-of select="$context"/> Really it would be nice to be able to set up "universal" params that affect all controllers/views/transforms. Maybe this should be added to the feature list. Jeff Schnitzer [email protected] > -----Original Message----- > From: Charles N. Harvey III [mailto:[email protected]] > Sent: Thursday, April 10, 2003 3:52 PM > To: [email protected] > Subject: [Mav-user] context variable in xsl > > Hey all. > I have a site that is built with the xsl option of Maverick. But, > I made all the links and images /appname. Well, now appname is > going to be appname.company.com/. So now I need to change all my > links. Not very farsighted of me. > > In Velocity it would be: > ${request.contextPath} > > In JSP it would be: > <c:out value="${context}"/> > > In XSL it would be: > ???? > > I don't know. Someone else actually developed this and I'm not all > that hot at xsl. I'm hoping it will be as easy as: > <xsl:value-of select="context" /> or > <xsl:value-of select="contextPath" /> > > > Is it? Does anyone know. This will be very helpful. > > Thanks. > > > Charlie > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of TotalView, The > debugger > for complex code. Debugging C/C++ programs can leave you feeling lost and > disoriented. TotalView can help you find your way. Available on major UNIX > and Linux platforms. Try it free. www.etnus.com > [INVALID FOOTER] ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com [INVALID FOOTER]