use of org.kohsuke.stapler.MetaClass in project hudson-2.x by hudson.
the class Hudson method doEval.
/**
* Evaluates the Jelly script submitted by the client.
*
* This is useful for system administration as well as unit testing.
*/
public void doEval(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
checkPermission(ADMINISTER);
requirePOST();
try {
MetaClass mc = WebApp.getCurrent().getMetaClass(getClass());
Script script = mc.classLoader.loadTearOff(JellyClassLoaderTearOff.class).createContext().compileScript(new InputSource(req.getReader()));
new JellyRequestDispatcher(this, script).forward(req, rsp);
} catch (JellyException e) {
throw new ServletException(e);
}
}
Aggregations