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

Java UrlValidator类代码示例

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

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



UrlValidator类属于org.apache.wicket.validation.validator包,在下文中一共展示了UrlValidator类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: urlForPage

import org.apache.wicket.validation.validator.UrlValidator; //导入依赖的package包/类
public static String urlForPage(Class<? extends Page> clazz, PageParameters pp, String _baseUrl) {
	RequestCycle rc = RequestCycle.get();
	String baseUrl = getBaseUrl();
	if (!new UrlValidator(new String[] {"http", "https"}).isValid(baseUrl) && !Strings.isEmpty(_baseUrl)) {
		baseUrl = _baseUrl;
	}
	return rc.getUrlRenderer().renderFullUrl(Url.parse(baseUrl + rc.mapUrlFor(clazz, pp)));
}
 
开发者ID:apache,项目名称:openmeetings,代码行数:9,代码来源:Application.java


示例2: CompanyProfileEdit

import org.apache.wicket.validation.validator.UrlValidator; //导入依赖的package包/类
public CompanyProfileEdit(String id, CompanyProfile companyProfile) {

		super(id, new Model(companyProfile));

		WebMarkupContainer companyNameContainer = new WebMarkupContainer(
				"companyNameContainer");
		companyNameContainer.add(new Label("companyNameLabel",
				new ResourceModel("profile.business.company.name")));
		TextField companyName = new TextField("companyName",
				new PropertyModel(companyProfile, "companyName"));
		companyName.setOutputMarkupId(true);
		companyNameContainer.add(companyName);
		String companyNameId = companyName.getMarkupId();
		Label companyNameAccessibilityLabel = new Label("companyNameAccessibilityLabel", new ResourceModel("accessibility.profile.companyname.input"));
		companyNameAccessibilityLabel.add(new AttributeAppender("for",new Model(companyNameId)," "));
		companyNameContainer.add(companyNameAccessibilityLabel);

		add(companyNameContainer);

		WebMarkupContainer companyWebAddressContainer = new WebMarkupContainer(
				"companyWebAddressContainer");
		companyWebAddressContainer.add(new Label("companyWebAddressLabel",
				new ResourceModel("profile.business.company.web")));

		TextField companyWebAddress = new TextField("companyWebAddress",
				new PropertyModel(companyProfile, "companyWebAddress")) {

			private static final long serialVersionUID = 1L;

			// add http:// if missing
			@Override
			protected void convertInput() {
				String input = getInput();

				if (StringUtils.isNotBlank(input)
						&& !(input.startsWith("http://") || input
								.startsWith("https://"))) {
					setConvertedInput("http://" + input);
				} else {
					setConvertedInput(StringUtils.isBlank(input) ? null : input);
				}
			}
		};
		companyWebAddress.setOutputMarkupId(true);
		companyWebAddress.add(new UrlValidator());
		companyWebAddressContainer.add(companyWebAddress);
		String companyUrlId = companyWebAddress.getMarkupId();
		Label companyUrlAccessibilityLabel = new Label("companyUrlAccessibilityLabel", new ResourceModel("accessibility.profile.companyurl.input"));
		companyUrlAccessibilityLabel.add(new AttributeAppender("for",new Model(companyUrlId)," "));
		companyWebAddressContainer.add(companyUrlAccessibilityLabel);

		final FeedbackLabel companyWebAddressFeedback = new FeedbackLabel(
				"companyWebAddressFeedback", companyWebAddress);
		companyWebAddressFeedback.setOutputMarkupId(true);
		companyWebAddressContainer.add(companyWebAddressFeedback);
		companyWebAddress.add(new ComponentVisualErrorBehaviour("onblur",
				companyWebAddressFeedback));
		companyWebAddress.add(new AttributeAppender("aria-describedby",new Model(companyWebAddressFeedback.getMarkupId())," "));

		add(companyWebAddressContainer);

		WebMarkupContainer companyDescriptionContainer = new WebMarkupContainer(
				"companyDescriptionContainer");
		companyDescriptionContainer.add(new Label("companyDescriptionLabel",
				new ResourceModel("profile.business.company.description")));
		TextArea companyDescription = new TextArea("companyDescription",
				new PropertyModel(companyProfile, "companyDescription"));
		companyDescription.setOutputMarkupId(true);
		companyDescriptionContainer.add(companyDescription);
		String companyDescriptionId = companyDescription.getMarkupId();
		Label companyDescriptionAccessibilityLabel = new Label("companyDescriptionAccessibilityLabel", new ResourceModel("accessibility.profile.companydescription.input"));
		companyDescriptionAccessibilityLabel.add(new AttributeAppender("for",new Model(companyDescriptionId)," "));
		companyDescriptionContainer.add(companyDescriptionAccessibilityLabel);

		add(companyDescriptionContainer);
	}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:77,代码来源:CompanyProfileEdit.java


示例3: addComponents

import org.apache.wicket.validation.validator.UrlValidator; //导入依赖的package包/类
@Override
protected void addComponents(Form<Settings> form) {    	    	
   	
       final TextField<String> urlField = new TextField<String>("baseUrl");
       urlField.add(new UrlValidator());
       urlField.setRequired(true);
       form.add(urlField);
       
       ContextImage urlImage = new ContextImage("urlImage","images/exclamation.png");        
       urlImage.add(new SimpleTooltipBehavior(getString("Settings.general.baseUrlTooltip")));
       form.add(urlImage);
       
       final TextField<String> reportsHomeField = new TextField<String>("reportsHome");
       reportsHomeField.setRequired(true);
       form.add(reportsHomeField);
       
       ContextImage homeImage = new ContextImage("homeImage","images/exclamation.png");        
       homeImage.add(new SimpleTooltipBehavior(getString("Settings.general.reportsHomeTooltip")));
       form.add(homeImage);
       
       final TextField<String> reportsUrlField = new TextField<String>("reportsUrl");
       reportsUrlField.add(new UrlValidator());
       reportsUrlField.setRequired(true);
       form.add(reportsUrlField);
       
       ContextImage repImage = new ContextImage("repImage","images/exclamation.png");        
       repImage.add(new SimpleTooltipBehavior(getString("Settings.general.reportsUrlTooltip")));
       form.add(repImage);
       
       final TextField<Integer> conTimeoutField = new TextField<Integer>("connectionTimeout");
       conTimeoutField.setRequired(true);
       form.add(conTimeoutField);
       ContextImage conImage = new ContextImage("conImage","images/information.png");        
       conImage.add(new SimpleTooltipBehavior(getString("Settings.general.connectTimeoutTooltip")));
       form.add(conImage);

       final TextField<Integer> timeoutField = new TextField<Integer>("queryTimeout");
       timeoutField.setRequired(true);
       form.add(timeoutField);
       ContextImage timeoutImage = new ContextImage("timeoutImage","images/information.png");        
       timeoutImage.add(new SimpleTooltipBehavior(getString("Settings.general.queryTimeoutTooltip")));
       form.add(timeoutImage);

       final TextField<Integer> updateIntervalField = new TextField<Integer>("updateInterval");
       updateIntervalField.setRequired(true);
       form.add(updateIntervalField);      
       ContextImage updateImage = new ContextImage("updateImage","images/information.png");        
       updateImage.add(new SimpleTooltipBehavior(getString("Settings.general.updateIntervalTooltip")));
       form.add(updateImage);
       
       final TextField<Integer> pollingIntervalField = new TextField<Integer>("pollingInterval");
       pollingIntervalField.setRequired(true);
       form.add(pollingIntervalField);      
       ContextImage poolingImage = new ContextImage("pollingImage","images/information.png");        
       poolingImage.add(new SimpleTooltipBehavior(getString("Settings.general.pollingIntervalTooltip")));
       form.add(poolingImage);
       
       final TextField<Integer> uploadSizeField = new TextField<Integer>("uploadSize");
       uploadSizeField.setRequired(true);
       form.add(uploadSizeField);      
       ContextImage uploadSizeImage = new ContextImage("uploadSizeImage","images/information.png");        
       uploadSizeImage.add(new SimpleTooltipBehavior(getString("Settings.general.uploadSizeTooltip")));
       form.add(uploadSizeImage);

       final CheckBox autoOpenField = new CheckBox("autoOpen");
       form.add(autoOpenField);

       Settings settings = storageService.getSettings();
       oldReportsHome = String.valueOf(settings.getReportsHome());        
   }
 
开发者ID:nextreports,项目名称:nextreports-server,代码行数:71,代码来源:GeneralSettingsPanel.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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