本文整理汇总了Java中org.apache.wicket.RequestCycle类的典型用法代码示例。如果您正苦于以下问题:Java RequestCycle类的具体用法?Java RequestCycle怎么用?Java RequestCycle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RequestCycle类属于org.apache.wicket包,在下文中一共展示了RequestCycle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: onSetPosition
import org.apache.wicket.RequestCycle; //导入依赖的package包/类
protected void onSetPosition(AjaxRequestTarget target) {
String lat = RequestCycle.get().getRequest().getParameter("lat");
String lng = RequestCycle.get().getRequest().getParameter("long");
findFields();
set(thetopic.getTopic().getTopicIF(), lat, PSI.ON_LATITUDE);
set(thetopic.getTopic().getTopicIF(), lng, PSI.ON_LONGITUDE);
latpan.getFieldValuesModel().setShowExtraField(false, false);
latpan.onUpdate(target);
lngpan.getFieldValuesModel().setShowExtraField(false, false);
lngpan.onUpdate(target);
onCloseOk(target);
}
示例3: getDisplayMessage
import org.apache.wicket.RequestCycle; //导入依赖的package包/类
/**
* @return
* @throws PortalException
* @throws SystemException
*/
private MBMessageDisplay getDisplayMessage() throws PortalException,
SystemException {
String className = Artigo.class.getName();
long idArtigo = ((ArtigoDisplay) getDefaultModelObject()).getId();
HttpServletRequest req = ((WebRequest) RequestCycle.get().getRequest())
.getHttpServletRequest();
ThemeDisplay td = (ThemeDisplay) req
.getAttribute(WebKeys.THEME_DISPLAY);
long userId = td.getUserId();
long groupId = td.getScopeGroupId();
MBMessageDisplay md = MBMessageLocalServiceUtil
.getDiscussionMessageDisplay(userId, groupId, className,
idArtigo, WorkflowConstants.STATUS_ANY);
return md;
}
示例4: LoginPage
import org.apache.wicket.RequestCycle; //导入依赖的package包/类
public LoginPage() {
super();
boolean logedIn = handleIFrameParameters();
if (!logedIn) {
ConstellioUser user = ConstellioSession.get().getUser();
if (user != null) {
PageFactoryPlugin pageFactoryPlugin = PluginFactory.getPlugin(PageFactoryPlugin.class);
if (user.isAdmin()) {
RequestCycle.get().setResponsePage(pageFactoryPlugin.getAdminPage());
} else {
RequestCycle.get().setResponsePage(pageFactoryPlugin.getSearchFormPage());
}
}
ConstellioSignInPanel signInPanel = new ConstellioSignInPanel("signInPanel");
add(signInPanel);
}
}
示例5: getObject
import org.apache.wicket.RequestCycle; //导入依赖的package包/类
/**
* @see org.apache.wicket.model.IModel#getObject()
*/
public List<T> getObject(String orderByProperty, Boolean orderByAsc) {
if (!attached)
{
attached = true;
transientModelObject = load(orderByProperty, orderByAsc);
if (log.isDebugEnabled())
{
log.debug("loaded transient object " + transientModelObject + " for " + this +
", requestCycle " + RequestCycle.get());
}
onAttach();
}
return transientModelObject;
}
示例6: detach
import org.apache.wicket.RequestCycle; //导入依赖的package包/类
@Override
public void detach(RequestCycle requestCycle) {
if (inputStreamModel != null) {
inputStreamModel.detach();
}
if (fileNameModel != null) {
fileNameModel.detach();
}
if (contentTypeModel != null) {
contentTypeModel.detach();
}
if (lengthModel != null) {
lengthModel.detach();
}
if (lastModifiedDateModel != null) {
lastModifiedDateModel.detach();
}
super.detach(requestCycle);
}
示例7: toAbsoluteUrl
import org.apache.wicket.RequestCycle; //导入依赖的package包/类
public static CharSequence toAbsoluteUrl(String url) {
// make relative links absolute
if (url.startsWith("../../")) {
HttpServletRequest req = ((WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest();
return req.getContextPath() + "/" + url.substring("../../".length());
} else {
return RequestUtils.toAbsolutePath(url);
}
}
示例8: FieldDefinitionLabel
import org.apache.wicket.RequestCycle; //导入依赖的package包/类
public FieldDefinitionLabel(String id, final FieldDefinitionModel fieldDefinitionModel) {
super(id);
Topic ontologyType = getPrimaryOntologyType(fieldDefinitionModel.getFieldDefinition());
add(new TopicLink<Topic>("ontologyType", new TopicModel<Topic>(ontologyType)) {
@Override
public String getLabel() {
return fieldDefinitionModel.getFieldDefinition().getFieldName();
}
@Override
public boolean isEnabled() {
return isOntologyTypeLinkEnabled(getTopic());
}
});
add(new TopicLink<FieldDefinition>("fieldDefinition", fieldDefinitionModel) {
@Override
protected String getLabel() {
return "<img src=\"" + RequestCycle.get().urlFor(new ResourceReference(ImageResource.class, "goto-details.gif"), ValueMap.EMPTY_MAP) + "\"/>";
}
@Override
public boolean getEscapeLabel() {
return false;
}
@Override
public boolean isVisible() {
return isFieldDefinitionLinkEnabled(getTopic());
}
@Override
public boolean isEnabled() {
return isFieldDefinitionLinkEnabled(getTopic());
}
});
}
示例9: getScopeGroupId
import org.apache.wicket.RequestCycle; //导入依赖的package包/类
/**
* @return
*/
private static long getScopeGroupId() {
HttpServletRequest request = ((WebRequest) RequestCycle.get()
.getRequest()).getHttpServletRequest();
ThemeDisplay td = (ThemeDisplay) request
.getAttribute(WebKeys.THEME_DISPLAY);
long scopeGroupId = td.getScopeGroupId();
return scopeGroupId;
}
示例10: LoginForm
import org.apache.wicket.RequestCycle; //导入依赖的package包/类
public LoginForm(String id, String markupId, MarkupContainer markupProvider) {
super(id, markupId, markupProvider);
setRenderBodyOnly(true);
SessionlessForm<Void> loginForm = new SessionlessForm<Void>("loginForm", RootPage.this.getClass(), getPageParameters()) {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit() {
String username = RootPage.this.username.getObject();
char[] password = RootPage.this.password.getObject().toCharArray();
HttpServletRequest request = ((WebRequest) RequestCycle.get().getRequest()).getHttpServletRequest();
UserModel user = app().authentication().authenticate(username, password, request.getRemoteAddr());
if (user == null) {
error(getString("gb.invalidUsernameOrPassword"));
} else if (user.username.equals(Constants.FEDERATION_USER)) {
// disallow the federation user from logging in via the
// web ui
error(getString("gb.invalidUsernameOrPassword"));
user = null;
} else {
loginUser(user);
}
}
};
TextField<String> unameField = new TextField<String>("username", username);
WicketUtils.setInputPlaceholder(unameField, markupProvider.getString("gb.username"));
loginForm.add(unameField);
NonTrimmedPasswordTextField pwField = new NonTrimmedPasswordTextField("password", password);
WicketUtils.setInputPlaceholder(pwField, markupProvider.getString("gb.password"));
loginForm.add(pwField);
add(loginForm);
}
示例11: rewriteStaticRelativeUrl
import org.apache.wicket.RequestCycle; //导入依赖的package包/类
@Override
public String rewriteStaticRelativeUrl(String url) {
// Avoid rewriting of non-static resources
String[] urlParts = url.split("/");
if (urlParts[urlParts.length - 1].indexOf('.') < 0 || isMatchingIgnoreUrlPrefixes(url)) {
return super.rewriteStaticRelativeUrl(url);
}
int depth = ((ServletWebRequest) RequestCycle.get().getRequest()).getDepthRelativeToWicketHandler();
return getRelativeStaticUrl(url, depth);
}
示例12: 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;
}
}
示例13: 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);
}
示例14: newRequestCycle
import org.apache.wicket.RequestCycle; //导入依赖的package包/类
@Override
public RequestCycle newRequestCycle(Request request, Response response) {
// WebRequest webRequest = (WebRequest) request;
// String displayLang = webRequest.getParameter(BaseConstellioPage.DISPLAY_LANG_PARAM);
// if (StringUtils.isNotBlank(displayLang)) {
// for (Locale supportedLocale : ConstellioSpringUtils.getSupportedLocales()) {
// if (supportedLocale.getLanguage().equals(displayLang)) {
// ConstellioSession.get().changeLocale(supportedLocale);
// break;
// }
// }
// }
return new PersistenceAwareWebRequestCycle(this, (WebRequest) request, response);
}
示例15: 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;
}