This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes detect current URL, referer in XSL??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "detect current URL, referer in XSL???" Watch "detect current URL, referer in XSL???" New topic
Author

detect current URL, referer in XSL???

Veronica Damian
Ranch Hand

Joined: Feb 04, 2006
Posts: 61
is it possible to detect current URL or referer in XSL?

(for conditionals.. for ex. if this stylesheet is in such-and-such a URL, etc..

where I work we do JSP/custom tags with code like, <framework:style uri="/xsl/dc_search.xsl....> so same XSL stylesheet might be used in more than one JSP..)

thank you..

-v
Subhadip Chatterjee
Ranch Hand

Joined: Dec 12, 2006
Posts: 93
Hey Veronica,
I can give you a small suggestion...you can get the user request URL, from HttpRequest instance itself. So, in your custom tag, create a HttpServletRequest instance (pageContext.getRequest()) and get the request URI using <instance>.getRequestURI()/<instance>.getRequestURL().
Store that into a Hashmap & pass it to the XSL trnasformer as a transform param. use the Hashmap key, as <xsl:param> in your XSL file. and use the param anywhere accross the XSL.


Refreshing life every moment...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: detect current URL, referer in XSL???
 
Similar Threads
JSP - How to get the current URL?
Find who send the request
calling javascript from an xslt sheet
passing param from request to xsl stylesheet..
request.getHeader("Referer") returning the url of the same page