Issue Details (XML | Word | Printable)

Key: JELLY-45
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: dion gillard
Reporter: Vincenz Braun
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Jelly

resource lookup in compiled scripts does not work properly

Created: 20/Mar/03 09:49 PM   Updated: 16/Sep/04 01:15 AM
Return to search
Component/s: core / taglib.core
Affects Version/s: None
Fix Version/s: 1.0-beta-5

Time Tracking:
Not Specified

Resolution Date: 16/Sep/04 01:15 AM


 Description  « Hide
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>



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Morgan Delagrange made changes - 04/Sep/03 11:15 PM
Field Original Value New Value
Original Estimate 0
Component/s core / taglib.core [ 10421 ]
Remaining Estimate 0h [ 0 ]
Morgan Delagrange made changes - 09/Sep/03 05:32 PM
Affects Version/s 1.0 [ 10216 ]
Morgan Delagrange made changes - 09/Sep/03 05:36 PM
Affects Version/s 1.0 [ 10216 ]
Fix Version/s 1.0 [ 10216 ]
dion gillard made changes - 13/Sep/04 02:36 AM
Assignee dion gillard [ diongillard ]
dion gillard made changes - 16/Sep/04 01:15 AM
Fix Version/s 1.0 [ 10216 ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
Fix Version/s 1.0-beta-5 [ 10783 ]