本文整理了Java中org.kohsuke.stapler.StaplerRequest.getServletContext()
方法的一些代码示例,展示了StaplerRequest.getServletContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。StaplerRequest.getServletContext()
方法的具体详情如下:
包路径:org.kohsuke.stapler.StaplerRequest
类名称:StaplerRequest
方法名:getServletContext
[英]Returns the ServletContext object given to the stapler dispatcher servlet.
[中]返回给定给订书机调度器servlet的ServletContext对象。
代码示例来源:origin: org.kohsuke.stapler/stapler
private ServletContext getContext(HttpServletRequest req) {
return ((StaplerRequest)req).getServletContext();
}
};
代码示例来源:origin: stapler/stapler
private ServletContext getContext(HttpServletRequest req) {
return ((StaplerRequest)req).getServletContext();
}
};
代码示例来源:origin: stapler/stapler
public ServletContext getServletContext() {
return getRequest().getServletContext();
}
代码示例来源:origin: stapler/stapler
public JellyBuilder(JellyContext context,XMLOutput output) {
this.context = context;
this.output = output;
this.request = Stapler.getCurrentRequest();
this.adjunctManager = AdjunctManager.get(request.getServletContext());
}
代码示例来源:origin: org.eclipse.hudson.stapler/stapler-jelly
/**
* Obtains the instance associated with the current request of the given {@link StaplerRequest}.
*
* <p>
* This method is handy when the caller already have the request object around,
* so that we can save {@link Stapler#getCurrentRequest()} call.
*/
public static AdjunctsInPage get(StaplerRequest request) {
AdjunctsInPage aip = (AdjunctsInPage) request.getAttribute(KEY);
if(aip==null)
request.setAttribute(KEY,aip=new AdjunctsInPage(AdjunctManager.get(request.getServletContext()),request));
return aip;
}
代码示例来源:origin: stapler/stapler
/**
* Obtains the instance associated with the current request of the given {@link StaplerRequest}.
*
* <p>
* This method is handy when the caller already have the request object around,
* so that we can save {@link Stapler#getCurrentRequest()} call.
*/
public static AdjunctsInPage get(StaplerRequest request) {
AdjunctsInPage aip = (AdjunctsInPage) request.getAttribute(KEY);
if(aip==null)
request.setAttribute(KEY,aip=new AdjunctsInPage(AdjunctManager.get(request.getServletContext()),request));
return aip;
}
代码示例来源:origin: stapler/stapler
protected void exportVariables(StaplerRequest req, StaplerResponse rsp, Script script, Object it, JellyContext context) {
Enumeration en = req.getAttributeNames();
// expose request attributes, just like JSP
while (en.hasMoreElements()) {
String name = (String) en.nextElement();
context.setVariable(name,req.getAttribute(name));
}
context.setVariable("request",req);
context.setVariable("response",rsp);
context.setVariable("it",it);
ServletContext servletContext = req.getServletContext();
context.setVariable("servletContext",servletContext);
context.setVariable("app",servletContext.getAttribute("app"));
// property bag to store request scope variables
context.setVariable("requestScope",context.getVariables());
// this variable is needed to make "jelly:fmt" taglib work correctly
context.setVariable("org.apache.commons.jelly.tags.fmt.locale",req.getLocale());
}
代码示例来源:origin: org.eclipse.hudson.stapler/stapler-jelly
protected void exportVariables(StaplerRequest req, StaplerResponse rsp, Script script, Object it, JellyContext context) {
Enumeration en = req.getAttributeNames();
// expose request attributes, just like JSP
while (en.hasMoreElements()) {
String name = (String) en.nextElement();
context.setVariable(name,req.getAttribute(name));
}
context.setVariable("request",req);
context.setVariable("response",rsp);
context.setVariable("it",it);
ServletContext servletContext = req.getServletContext();
context.setVariable("servletContext",servletContext);
context.setVariable("app",servletContext.getAttribute("app"));
// property bag to store request scope variables
context.setVariable("requestScope",context.getVariables());
// this variable is needed to make "jelly:fmt" taglib work correctly
context.setVariable("org.apache.commons.jelly.tags.fmt.locale",req.getLocale());
}
内容来源于网络,如有侵权,请联系作者删除!