本文整理汇总了Java中org.apache.wicket.RequestCycle.get方法的典型用法代码示例。如果您正苦于以下问题:Java RequestCycle.get方法的具体用法?Java RequestCycle.get怎么用?Java RequestCycle.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.RequestCycle
的用法示例。
在下文中一共展示了RequestCycle.get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: defineEntryPoint
import org.apache.wicket.RequestCycle; //导入方法依赖的package包/类
private void defineEntryPoint(IRequestTarget aTarget) {
RequestCycle requestCycle = RequestCycle.get();
if (!(requestCycle instanceof WebRequestCycle)) {
return;
}
String entryPoint = formatEntryPoint(aTarget);
WebResponse response = ((WebRequestCycle) requestCycle).getWebResponse();
response.setHeader(ENTRY_POINT_HEADER, entryPoint);
}
示例2: flagWicketSession
import org.apache.wicket.RequestCycle; //导入方法依赖的package包/类
protected void flagWicketSession(AuthenticationType authenticationType) {
RequestCycle requestCycle = RequestCycle.get();
if (requestCycle != null) {
// flag the Wicket session, if this is a Wicket request
GitBlitWebSession session = GitBlitWebSession.get();
session.authenticationType = authenticationType;
}
}
示例3: GitblitRedirectException
import org.apache.wicket.RequestCycle; //导入方法依赖的package包/类
public <C extends Page> GitblitRedirectException(Class<C> pageClass, PageParameters params) {
RequestCycle cycle = RequestCycle.get();
String relativeUrl = cycle.urlFor(pageClass, params).toString();
String absoluteUrl = RequestUtils.toAbsolutePath(relativeUrl);
cycle.setRequestTarget(new RedirectRequestTarget(absoluteUrl));
cycle.setRedirect(true);
}
示例4: getExternalParams
import org.apache.wicket.RequestCycle; //导入方法依赖的package包/类
private static String getExternalParams(CharSequence encoded) {
String externalParams;
WebRequestCycle webRequestCycle = (WebRequestCycle) RequestCycle.get();
HttpServletRequest request = webRequestCycle.getWebRequest().getHttpServletRequest();
GlobalExtraParamsPlugin globalExtraParamsPlugin = PluginFactory.getPlugin(GlobalExtraParamsPlugin.class);
if (globalExtraParamsPlugin != null) {
externalParams = globalExtraParamsPlugin.getExtraParams(encoded, request);
} else {
externalParams = "";
}
return externalParams;
}
示例5: SmbServletPage
import org.apache.wicket.RequestCycle; //导入方法依赖的package包/类
public SmbServletPage(PageParameters parameters) throws SmbException {
super(parameters);
String recordID = parameters.getString(RECORD_ID);
if (StringUtils.isBlank(recordID)) {
throw new WicketRuntimeException(RECORD_ID + " parameter is required");
}
String collectionName = parameters.getString(COLLECTION);
if (StringUtils.isBlank(collectionName)) {
throw new WicketRuntimeException(COLLECTION + " parameter is required");
}
SmbFile downloadedSmbFile = getSmbFile(Long.valueOf(recordID), collectionName);
WebRequestCycle requestCycle = (WebRequestCycle) RequestCycle.get();
HttpServletResponse response = requestCycle.getWebResponse().getHttpServletResponse();
response.setContentType("application/octet-stream" );
response.setContentLength( (int) downloadedSmbFile .length() );
response.setHeader( "Content-Disposition", "attachment; filename=\"" + downloadedSmbFile.getName() + "\"" );
try{
InputStream is = new BufferedInputStream(downloadedSmbFile.getInputStream());
IOUtils.copy(is, response.getOutputStream());
IOUtils.closeQuietly(is);
} catch(IOException e){
throw new RuntimeException(e);
}
}
示例6: getTopicMap
import org.apache.wicket.RequestCycle; //导入方法依赖的package包/类
public TopicMap getTopicMap(String topicMapId) {
OntopolyRequestCycle rc = (OntopolyRequestCycle)RequestCycle.get();
return rc.getTopicMap(topicMapId);
}