本文整理汇总了Java中org.apache.wicket.request.IRequestCycle类的典型用法代码示例。如果您正苦于以下问题:Java IRequestCycle类的具体用法?Java IRequestCycle怎么用?Java IRequestCycle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IRequestCycle类属于org.apache.wicket.request包,在下文中一共展示了IRequestCycle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: respond
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
/** {@inheritDoc} */
public void respond(final IRequestCycle requestCycle)
{
String location = requestCycle.getUrlRenderer().renderRelativeUrl(Url.parse(getRedirectUrl()));
WebResponse response = (WebResponse)requestCycle.getResponse();
if (status == HttpServletResponse.SC_MOVED_TEMPORARILY)
{
response.sendRedirect(location);
}
else
{
response.setStatus(status);
response.setHeader("Location", location);
}
}
示例2: onRequest
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public void onRequest() {
final File file = initFile();
IResourceStream resourceStream = new FileResourceStream(new File(file));
getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(
new ResourceStreamRequestHandler(resourceStream) {
@Override
public void respond(IRequestCycle requestCycle) {
try {
super.respond(requestCycle);
} finally {
if (removeFile) {
LOGGER.debug("Removing file '{}'.", new Object[]{file.getAbsolutePath()});
Files.remove(file);
}
}
}
}.setFileName(file.getName()).setContentDisposition(ContentDisposition.ATTACHMENT)
.setCacheDuration(Duration.ONE_SECOND));
}
示例3: onRequest
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public void onRequest() {
IResourceStream resourceStream = getResourceStream();
if (resourceStream == null) {
return; // We hope the error was already processed and will be shown.
}
ResourceStreamRequestHandler reqHandler = new ResourceStreamRequestHandler(resourceStream) {
@Override
public void respond(IRequestCycle requestCycle) {
super.respond(requestCycle);
}
}.setContentDisposition(ContentDisposition.ATTACHMENT)
.setCacheDuration(Duration.ONE_SECOND);
if (StringUtils.isNotEmpty(getFileName())){
reqHandler.setFileName(getFileName());
}
getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(reqHandler);
}
示例4: respond
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void respond(IRequestCycle requestCycle) {
String script = ToastrHelper.generateJs(singularException, ToastrType.ERROR, false);
WebResponse response = (WebResponse)requestCycle.getResponse();
final String encoding = Application.get()
.getRequestCycleSettings()
.getResponseRequestEncoding();
// Set content type based on markup type for page
response.setContentType("text/xml; charset=" + encoding);
// Make sure it is not cached by a client
response.disableCaching();
response.write("<?xml version=\"1.0\" encoding=\"");
response.write(encoding);
response.write("\"?>");
response.write("<ajax-response>");
response.write("<evaluate><![CDATA[" + script + "]]></evaluate>");
response.write("</ajax-response>");
}
示例5: onRequest
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public void onRequest() {
final File file = initFile();
IResourceStream resourceStream = new FileResourceStream(new File(file));
getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(
new ResourceStreamRequestHandler(resourceStream) {
@Override
public void respond(IRequestCycle requestCycle) {
try {
super.respond(requestCycle);
} finally {
if (removeFile) {
LOGGER.debug("Removing file '{}'.", new Object[]{file.getAbsolutePath()});
Files.remove(file);
}
}
}
}.setFileName(file.getName()).setContentDisposition(ContentDisposition.ATTACHMENT)
.setCacheDuration(Duration.ONE_SECOND));
}
示例6: onRequest
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public void onRequest() {
IResourceStream resourceStream = getResourceStream();
if (resourceStream == null) {
return; // We hope the error was already processed and will be shown.
}
ResourceStreamRequestHandler reqHandler = new ResourceStreamRequestHandler(resourceStream) {
@Override
public void respond(IRequestCycle requestCycle) {
super.respond(requestCycle);
}
}.setContentDisposition(ContentDisposition.ATTACHMENT)
.setCacheDuration(Duration.ONE_SECOND);
if (StringUtils.isNotEmpty(getFileName())){
reqHandler.setFileName(getFileName());
}
getComponent().getRequestCycle().scheduleRequestHandlerAfterCurrent(reqHandler);
}
示例7: initMethods
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
private static Method[] initMethods() {
HashSet<Method> aux = new HashSet<Method>(Arrays.asList(RequestTargetTester.class.getDeclaredMethods()));
aux.remove(getMethodHelper("addListener", AjaxRequestTarget.IListener.class));
aux.remove(getMethodHelper("respond", IRequestCycle.class));
aux.remove(getMethodHelper("detach", IRequestCycle.class));
return aux.toArray(new Method[aux.size()]);
}
示例8: initLessCSS
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public static void initLessCSS(Class<? extends WebPage> appClass, IHeaderResponse response,
IRequestCycle requestCycle, PathTupel... pathTupels) {
for (int i = 0; pathTupels != null && i < pathTupels.length; i++) {
PathTupel pathTupel = pathTupels[i];
addStylesheetLessCSS(response, requestCycle, pathTupel);
}
if (isDevelopement()) {
response.render(JavaScriptHeaderItem
.forReference(new PackageResourceReference(LessCSSHelper.class, LESS_JS)));
}
}
示例9: addStylesheetLessCSS
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
public static void addStylesheetLessCSS(IHeaderResponse response, IRequestCycle requestCycle, PathTupel pathTupel) {
if (isDevelopement()) {
// dev mode
response.render(StringHeaderItem.forString(MessageFormat.format(STYLESHEET_LESS,
UrlUtils.rewriteToContextRelative(pathTupel.lessPath, requestCycle))));
} else {
//prod mode
response.render(CssHeaderItem.forUrl(pathTupel.cssPath));
}
}
示例10: onClick
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void onClick()
{
final File file = getModelObject();
if (file == null)
{
throw new IllegalStateException(getClass().getName() +
" failed to retrieve a File object from model");
}
String fileName = encodedFileName();
final IResourceStream resourceStream = new FileResourceStream(
new org.apache.wicket.util.file.File(file)) {
private static final long serialVersionUID = 1L;
@Override
public String getContentType() {
return "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml";
}
};
getRequestCycle().scheduleRequestHandlerAfterCurrent(
new ResourceStreamRequestHandler(resourceStream)
{
@Override
public void respond(IRequestCycle requestCycle)
{
super.respond(requestCycle);
Files.remove(file);
}
}.setFileName(fileName)
.setContentDisposition(ContentDisposition.ATTACHMENT));
}
示例11: detach
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
/** {@inheritDoc} */
public void detach(final IRequestCycle requestCycle)
{
}
示例12: detach
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void detach(IRequestCycle requestCycle) {
}
示例13: respond
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void respond(IRequestCycle requestCycle) {
inner.respond(requestCycle);
}
示例14: detach
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void detach(IRequestCycle requestCycle) {
inner.detach(requestCycle);
}
示例15: respond
import org.apache.wicket.request.IRequestCycle; //导入依赖的package包/类
@Override
public void respond(IRequestCycle requestCycle) {
OrientDbWebApplication.get().onUnauthorizedInstantiation(component);
}