You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by co...@jakarta.apache.org on 2004/09/16 03:16:39 UTC

[jira] Closed: (JELLY-45) resource lookup in compiled scripts does not work properly

Message:

   The following issue has been closed.

   Resolver: dion gillard
       Date: Wed, 15 Sep 2004 6:15 PM

Updated TagScript and StaticTagScript to set the context urls when running a script.
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JELLY-45

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JELLY-45
    Summary: resource lookup in compiled scripts does not work properly
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: jelly
 Components: 
             core / taglib.core
   Fix Fors:
             1.0-beta-5

   Assignee: dion gillard
   Reporter: Vincenz Braun

    Created: Thu, 20 Mar 2003 1:49 PM
    Updated: Wed, 15 Sep 2004 6:15 PM

Description:
Take the following code snippet:

JellyContext context = new JellyContext();
URL url = ImportTestcase.class.getResource("/resources/import.jelly");
XMLOutput out = XMLOutput.createXMLOutput(System.out);
// this works because of the created child context that has knowledge
// of the URL
context.runScript(url, out);

// This does not work because context has no currentURL set
// This results in a NullPointerException when resolving the
// stylesheet
Script script = context.compileScript(url);
script.run(context, out);
out.flush()

A compiled script should manage the lookup of referenced
resources by its own regardless of the context set. If you
cache scripts and use different contexts you do not always know
where the script is from.
That's why context.setCurrentURL(...) is no solution.

// import.jelly
<?xml version="1.0" encoding="ISO-8859-1"?>
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" >
	<x:transform xslt="import.xsl">
		<x:param name="language" value="DE"/>
		<root/>
	</x:transform>
</j:jelly>



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org