/** * Set the context's root and current URL if not present * @param context * @throws JellyTagException */ protected void setContextURLs(JellyContext context) throws JellyTagException { if(scriptURL == null) return; if(context.getRootURL()==null) { context.setRootURL(scriptURL); } context.setCurrentURL(scriptURL); }
/** * Set the context's root and current URL if not present * @param context * @throws JellyTagException */ protected void setContextURLs(JellyContext context) throws JellyTagException { if(scriptURL == null) return; if(context.getRootURL()==null) { context.setRootURL(scriptURL); } context.setCurrentURL(scriptURL); }
/** * Set the context's root and current URL if not present * @param context * @throws JellyTagException */ protected void setContextURLs(JellyContext context) throws JellyTagException { if(scriptURL == null) return; if(context.getRootURL()==null) { context.setRootURL(scriptURL); } context.setCurrentURL(scriptURL); }
/** * Run a jelly script. * * @param scriptInputStream Script input stream. * @param systemId the system identifier to help resolve relative URLs * @param rootUrl Root explicit context of the script. * @param context Jelly context. * @param output Output sink. * @throws Exception If an error occurs while locating, compiling or * executing the script. */ public static void runScript( InputStream scriptInputStream, String systemId, URL rootUrl, JellyContext context, XMLOutput output ) throws Exception { URL oldRoot = context.getRootURL(); URL oldCurrent = context.getCurrentURL(); if ( rootUrl != null ) { context.setRootURL( rootUrl ); context.setCurrentURL( rootUrl ); } Script script = compileScript( scriptInputStream, systemId, context ); script.run( context, output ); context.setRootURL( oldRoot ); context.setCurrentURL( oldCurrent ); }
newJellyContext.setRootURL( newJellyContextURL ); newJellyContext.setCurrentURL( newJellyContextURL ); newJellyContext.setExport( export );
newJellyContext.setRootURL( newJellyContextURL ); newJellyContext.setCurrentURL( newJellyContextURL ); newJellyContext.setExport( export );
/** * Set the context's root and current URL if not present * @param context * @throws JellyTagException */ protected void setContextURLs(JellyContext context) throws JellyTagException { if ((context.getCurrentURL() == null || context.getRootURL() == null) && scriptURL != null) { if (context.getRootURL() == null) context.setRootURL(scriptURL); if (context.getCurrentURL() == null) context.setCurrentURL(scriptURL); } }
newJellyContext.setRootURL( newJellyContextURL ); newJellyContext.setCurrentURL( newJellyContextURL ); newJellyContext.setExport( export );
newJellyContext.setRootURL( newJellyContextURL ); newJellyContext.setCurrentURL( newJellyContextURL ); newJellyContext.setExport( export );
context.setRootURL(rootURL); context.setCurrentURL(currentURL); context.getVariables().put(PARENT_TAG,oldParent);
context.setRootURL(rootURL); context.setCurrentURL(currentURL);
} finally { context.setCurrentURL(currentURL); context.setRootURL(rootURL);
} finally { context.setCurrentURL(currentURL); context.setRootURL(rootURL);
context.setRootURL(rootURL); context.setCurrentURL(currentURL);
} finally { context.setCurrentURL(currentURL); context.setRootURL(rootURL);
context.setRootURL(rootURL); context.setCurrentURL(currentURL);
} finally { context.setCurrentURL(currentURL); context.setRootURL(rootURL);