• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RequestCycle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.wicket.RequestCycle的典型用法代码示例。如果您正苦于以下问题:Java RequestCycle类的具体用法?Java RequestCycle怎么用?Java RequestCycle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RequestCycle类属于org.apache.wicket包,在下文中一共展示了RequestCycle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
 
开发者ID:mpobjects,项目名称:xrebelhub-wicket-endpoints,代码行数:10,代码来源:XrhRequestLogger.java


示例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);
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:17,代码来源:ModalGeoPickerPage.java


示例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;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:22,代码来源:ComentariosPanel.java


示例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);
	}
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:20,代码来源:LoginPage.java


示例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;
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:20,代码来源:SortableListModel.java


示例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);
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:20,代码来源:DownloadInputStreamLink.java


示例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);
  }
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:10,代码来源:AbsoluteUrlRequestCodingStrategy.java


示例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());
    }
  });
  
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:37,代码来源:FieldDefinitionLabel.java


示例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;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:12,代码来源:BloqueioForumHome.java


示例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);
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:37,代码来源:RootPage.java


示例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);
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:12,代码来源:StaticCodingStrategy.java


示例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;
	}
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:9,代码来源:GitBlit.java


示例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);
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:8,代码来源:GitblitRedirectException.java


示例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);
    }
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:15,代码来源:ConstellioApplication.java


示例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;
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:13,代码来源:ConstellioApplication.java


示例16: 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);
}
  }
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:31,代码来源:SmbServletPage.java


示例17: handleUsernamePasswordParameters

import org.apache.wicket.RequestCycle; //导入依赖的package包/类
private boolean handleUsernamePasswordParameters() {
	String iframeLoginUsername = RequestCycle.get().getRequest().getParameter("iframe_username");
	String iframeLoginPassword = RequestCycle.get().getRequest().getParameter("iframe_password");

	if (iframeLoginUsername != null && iframeLoginPassword != null) {
		boolean valid =  ConstellioSession.get().signIn(iframeLoginUsername, iframeLoginPassword);
		if (valid) {
			ConstellioSession.get().signIn(iframeLoginUsername, iframeLoginPassword);
			WebRequestCycle.get().setResponsePage(SearchFormPage.class);
			return true;
		}
	}
	return false;
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:15,代码来源:LoginPage.java


示例18: onBeforeRender

import org.apache.wicket.RequestCycle; //导入依赖的package包/类
@Override
protected void onBeforeRender() {
    HttpServletRequest httpRequest = ((WebRequest) RequestCycle.get().getRequest()).getHttpServletRequest();
    String referer = httpRequest.getHeader("referer");
    if (referer != null) {
        RequestCycle.get().setRequestTarget(new RedirectRequestTarget(referer));
    } else {
        setResponsePage(ConstellioApplication.get().getHomePage());
    }
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:11,代码来源:SearchExceptionHandlingPage.java


示例19: setCookie

import org.apache.wicket.RequestCycle; //导入依赖的package包/类
public static void setCookie(String cookieName, String cookieValue, int expiryInSeconds) {
	Cookie cookie = getCookie(cookieName);
	if (cookie == null) {
		cookie = new Cookie(cookieName, cookieValue);
	}
	cookie.setMaxAge(expiryInSeconds);
	((WebResponse) RequestCycle.get().getResponse()).addCookie(cookie);
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:9,代码来源:CookieUtils.java


示例20: detach

import org.apache.wicket.RequestCycle; //导入依赖的package包/类
@Override
public void detach() {
	if (attached) {
		attached = false;
		transientModelObject = null;

		if (log.isDebugEnabled()) {
			log.debug("removed transient object for " + this + ", requestCycle " +
					RequestCycle.get());
		}
		onDetach();
	}
}
 
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:14,代码来源:SortableListModel.java



注:本文中的org.apache.wicket.RequestCycle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DefaultEventExecutor类代码示例发布时间:2022-05-22
下一篇:
Java TextureParameter类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap