當前位置: 首頁>>代碼示例>>Java>>正文


Java WebApplication類代碼示例

本文整理匯總了Java中org.apache.wicket.protocol.http.WebApplication的典型用法代碼示例。如果您正苦於以下問題:Java WebApplication類的具體用法?Java WebApplication怎麽用?Java WebApplication使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WebApplication類屬於org.apache.wicket.protocol.http包,在下文中一共展示了WebApplication類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ImageModel

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
/**
 * The constructor for this class, which provides the images for the web
 * application.
 *
 * @param component
 */
public ImageModel(final Component component) {
	final SharedResources sharedResources = WebApplication.get().getSharedResources();
	final ResourceReference aligmentImageReference = sharedResources.get(ImageReference.class, "alignment.jpg", null, null, null, false);
	final ResourceReference eventStreamImageReference = sharedResources.get(ImageReference.class, "eventStream.jpg", null, null, null, false);
	final ResourceReference groupImageReference = sharedResources.get(ImageReference.class, "group.jpg", null, null, null, false);
	final ResourceReference processImageReference = sharedResources.get(ImageReference.class, "process.jpg", null, null, null, false);

	this.images.add(new CarouselImage(component.getRequestCycle().urlFor(eventStreamImageReference, null).toString(), "Event streaming platform", "Capture all your event streams in one platform"));

	this.images.add(new CarouselImage(component.getRequestCycle().urlFor(groupImageReference, null).toString(), "Next generation process management", "Monitor and analyze your processes"));

	this.images.add(new CarouselImage(component.getRequestCycle().urlFor(processImageReference, null).toString(), "Process optimization", "Capture running process instances to optimize them"));

	this.images.add(new CarouselImage(component.getRequestCycle().urlFor(aligmentImageReference, null).toString(), "Business and IT alignment", "Gain knowlegde through combining business and IT"));
}
 
開發者ID:bptlab,項目名稱:Unicorn,代碼行數:22,代碼來源:ImageModel.java

示例2: init

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
@Override
public void init(WebApplication webApplication) {
	
	webApplication.setPageManagerProvider(new DefaultPageManagerProvider(webApplication) {
		protected IDataStore newDataStore() {
			IRedisSettings settings = new RedisSettings();
			settings.setHostname(prop.getHostname());
			settings.setPort(prop.getPort());
			settings.setRecordTtl(TypeParser.parse(prop.getRecordTtl(), prop.getRecordTtlUnit()));
			
			RedisDataStore redisDataStore = new RedisDataStore(settings );
			return new SessionQuotaManagingDataStore(redisDataStore, TypeParser.parse(prop.getSessionSize(), prop.getSessionUnit()));
		}
	});

	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", prop)
			.build());
	
}
 
開發者ID:MarcGiffing,項目名稱:wicket-spring-boot,代碼行數:21,代碼來源:DataStoreRedisConfig.java

示例3: init

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
@Override
public void init(WebApplication webApplication) {
	
	webApplication.setPageManagerProvider(new DefaultPageManagerProvider(webApplication) {
		@Override
		protected IDataStore newDataStore() {
			HazelcastDataStore hazelcastDataStore = new HazelcastDataStore(hazelcastInstance);
			return new SessionQuotaManagingDataStore(hazelcastDataStore, TypeParser.parse(prop.getSessionSize(), prop.getSessionUnit()));
		}
	});
	
	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", prop)
			.build());

}
 
開發者ID:MarcGiffing,項目名稱:wicket-spring-boot,代碼行數:17,代碼來源:DataStoreHazelcastConfig.java

示例4: init

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
@Override
public void init(WebApplication webApplication) {
	final ICassandraSettings settings = new CassandraSettings();
	settings.getContactPoints().addAll(prop.getContactPoints());
	settings.setTableName(prop.getTableName());
	settings.setKeyspaceName(prop.getKeyspaceName());
	settings.setRecordTtl(TypeParser.parse(prop.getRecordTtl(), prop.getRecordTtlUnit()));

	webApplication.setPageManagerProvider(new DefaultPageManagerProvider(webApplication) {
		@Override
		protected IDataStore newDataStore() {
			return new SessionQuotaManagingDataStore(new CassandraDataStore(settings),
					TypeParser.parse(prop.getSessionSize(), prop.getSessionUnit()));
		}
	});
	
	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", prop)
			.build());
}
 
開發者ID:MarcGiffing,項目名稱:wicket-spring-boot,代碼行數:21,代碼來源:DataStoreCassandraConfig.java

示例5: init

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
@Override
public void init(WebApplication webApplication) {
	AnnotationsShiroAuthorizationStrategy authz = new AnnotationsShiroAuthorizationStrategy();
	webApplication.getSecuritySettings().setAuthorizationStrategy( authz );

	if ( classCandidates.getSignInPageCandidates().size() <= 0 ) {
		throw new IllegalStateException( "Couln't find sign in page - please annotated the sign in page with @" + WicketSignInPage.class.getName() );
	}
	if ( classCandidates.getAccessDeniedPageCandidates().size() <= 0 ) {
		throw new IllegalStateException( "Couln't find access denied in page - please annotated the sign in page with @" + WicketAccessDeniedPage.class.getName() );
	}
	Class<WebPage> signInPage = classCandidates.getSignInPageCandidates().iterator().next().getCandidate();
	Class<Page> accessDeniedPage = classCandidates.getAccessDeniedPageCandidates().iterator().next().getCandidate();
	webApplication.getSecuritySettings()
			.setUnauthorizedComponentInstantiationListener( new ShiroUnauthorizedComponentListener( signInPage, accessDeniedPage, authz ) );

}
 
開發者ID:MarcGiffing,項目名稱:wicket-spring-boot,代碼行數:18,代碼來源:ShiroSecurityConfig.java

示例6: init

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
@Override
public void init(WebApplication webApplication) {
	MarkupSettings markupSettings = webApplication.getMarkupSettings();

	if(props.getDefaultMarkupEncoding() != null){
		markupSettings.setDefaultMarkupEncoding(props.getDefaultMarkupEncoding());
	}
	
	markupSettings.setAutomaticLinking(props.isAutomaticLinking());
	markupSettings.setCompressWhitespace(props.isCompressWhitespace());
	markupSettings.setStripComments(props.isStripComments());
	markupSettings.setStripWicketTags(props.isStripWicketTags());
	markupSettings.setThrowExceptionOnMissingXmlDeclaration(props.isThrowExceptionOnMissingXmlDeclaration());
	
	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", props)
			.build());
	
}
 
開發者ID:MarcGiffing,項目名稱:wicket-spring-boot,代碼行數:20,代碼來源:MarkupSettingsConfig.java

示例7: init

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
@Override
public void init(WebApplication webApplication) {
	StoreSettings storeSettings = webApplication.getStoreSettings();
	if (props.getAsynchronous() != null) {
		storeSettings.setAsynchronous(props.getAsynchronous());
	}
	if (props.getAsynchronousQueueCapacity() != null) {
		storeSettings.setAsynchronousQueueCapacity(props.getAsynchronousQueueCapacity());
	}
	if (props.getFileStoreFolder() != null) {
		storeSettings.setFileStoreFolder(new File(props.getFileStoreFolder()));
	}
	if (props.getInmemoryCacheSize() != null) {
		storeSettings.setInmemoryCacheSize(props.getInmemoryCacheSize());
	}
	storeSettings.setMaxSizePerSession(TypeParser.parse(props.getSessionSize(), props.getSessionUnit()));
	
	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", props)
			.build());
}
 
開發者ID:MarcGiffing,項目名稱:wicket-spring-boot,代碼行數:22,代碼來源:StoreSettingsConfig.java

示例8: init

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
@Override
public void init(WebApplication webApplication) {
	CsrfPreventionRequestCycleListener listener = new CsrfPreventionRequestCycleListener();
	listener.setConflictingOriginAction(props.getConflictingOriginAction());
	listener.setErrorCode(props.getErrorCode());
	listener.setErrorMessage(props.getErrorMessage());
	listener.setNoOriginAction(props.getNoOriginAction());
	for (String acceptedOrigin : props.getAcceptedOrigins()) {
		listener.addAcceptedOrigin(acceptedOrigin);
	}
	webApplication.getRequestCycleListeners().add(listener);
	
	wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
			.withDetail("properties", props)
			.build());
}
 
開發者ID:MarcGiffing,項目名稱:wicket-spring-boot,代碼行數:17,代碼來源:CsrfAttacksPreventionConfig.java

示例9: createTester

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
private WicketTester createTester(){
	WicketTester tester = new WicketTester(new WebApplication() {
		
		@Override
		public Class<? extends Page> getHomePage() {
			return null;
		}
	}){
		@Override
		protected String createPageMarkup(String componentId) {
			return "<div class=\"pagination pagination-small pagination-right\" wicket:id=\"paginator\">"+
					"</div>";
		}
	};
	
	return tester;
}
 
開發者ID:premium-minds,項目名稱:pm-wicket-utils,代碼行數:18,代碼來源:BootstrapPaginatorTest.java

示例10: notify

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
public static void notify(AjaxRequestTarget target, String message, String notificationFunction) {

        final String contextPath = WebApplication.get().getServletContext().getContextPath();

        // Das hier ist etwas tricky: die Javascript-Module für die schicke Meldungsanzeige
        // über PNotify müssen in den Body und nicht in den Header. Wir dürfen aber keine
        // Annahme darüber treffen, ob die Module im Body der aktuellen Page bereits drin
        // stecken. Insbesondere modale Dialoge sind direkt von DMDWebPage abgeleitet und
        // erhalten keine Body-Bestandteile über irgend ein Basis-HTML. Deswegen laden wir
        // die Skripte über eine enstrechende jQuery-Funktion dynamisch nach. Das Auslösen
        // der eigentlichen Benachrichtigung erfolgt dann als Callback, den jQuery nach dem
        // vollständigen Laden der Skripte aufruft. Der Code ist nach den Beispielen auf
        // http://api.jquery.com/jQuery.getScript/ gebaut.
        String escapedMessage = message.replace("'", "\\'").replace("\"", "&quot;");
        String script = "$.getScript('" + contextPath + "/js/add-ons/jquery.pnotify.js', function() {" + //
                "    $.getScript('" + contextPath + "/js/add-ons/dmd.notifier.js', function() { " + //
                "        Notifier." + notificationFunction + "('" + escapedMessage + "');" + //
                "     });" + //
                "});";
        target.appendJavaScript(script);
    }
 
開發者ID:Nocket,項目名稱:nocket,代碼行數:22,代碼來源:Notifier.java

示例11: loadDomainRegistry

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
private DomainRegistry<DomainObjectReference> loadDomainRegistry() {
    // Wicket's development mode allows to reload classes at runtime, so in that mode
    // we must not cache any data structures which depend on class structures. The
    // domain registry prototypes are such a candidate.
    if (WebApplication.get().getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT)
        return constructDomainRegistry();

    synchronized (DMDWebGenPageContext.class) {
        String domainClassName = page.getDefaultModelObject().getClass().getName();
        DomainRegistry<DomainObjectReference> registry = domainRegistryPrototypes.get(domainClassName);
        if (registry == null) {
            registry = constructDomainRegistry();
            domainRegistryPrototypes.put(domainClassName, registry);
            return registry;
        } else {
            // Construct a new DomainRegistry from an existing prototype rather than from
            // traversing the domain class structure. Creation from prototype is much faster.
            return registry.replicate(page.getDefaultModelObject());
        }
    }
}
 
開發者ID:Nocket,項目名稱:nocket,代碼行數:22,代碼來源:DMDWebGenPageContext.java

示例12: getDomainClassReference

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
public static DomainClassReference getDomainClassReference(Class<?> domainClass, boolean runtime) {
    // Wicket's development mode allows to reload classes at runtime, so in that mode
    // we must not cache any data structures which depend on class structures. The
    // DomainClassReference cache is such a candidate.
    if (!runtime || WebApplication.get().getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT) {
        return new DomainClassReference(domainClass);
    }

    synchronized (DomainClassReferenceFactory.class) {
        String domainClassName = domainClass.getName();
        DomainClassReference ref = domainClassReferenceCache.get(domainClassName);
        if (ref == null) {
            ref = new DomainClassReference(domainClass);
            domainClassReferenceCache.put(domainClassName, ref);
        }
        return ref;
    }
}
 
開發者ID:Nocket,項目名稱:nocket,代碼行數:19,代碼來源:DomainClassReferenceFactory.java

示例13: install

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
/**
 * Install Leaflet with given settings to application.
 * If application already has Leaflet installed, it ignores new settings.
 *
 * @param application application, which Leaflet should be bounded to.
 * @param settings custom settings, which are used to initialized library
 * @throws IllegalArgumentException if application is {@code null}.
 */
public static void install(WebApplication application, LeafletSettings settings) {
    // install Leaflet.js with given configuration
    Args.notNull(application, "application");

    if (application.getMetaData(LEAFLET_SETTINGS_KEY) == null) {
        LeafletSettings settingsOrDefault = settings != null ? settings : new DefaultLeafletSettings();
        application.setMetaData(LEAFLET_SETTINGS_KEY, settingsOrDefault);

        if (settingsOrDefault.autoAppendResources()) {
            application.getComponentInstantiationListeners().add(new LeafletResourceAppender());
        }

        if (settingsOrDefault.useWebJars()) {
            WicketWebjars.install(application);
        }
    }
}
 
開發者ID:DrunkenPandaFans,項目名稱:wicket-leaflet,代碼行數:26,代碼來源:Leaflet.java

示例14: createWebApp

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
private WebApplication createWebApp(final LeafletSettings settings, final boolean installLeaflets) {
    return new WebApplication() {

        @Override
        protected void init() {
            super.init();
            if (installLeaflets) {
                if (settings == null) {
                    Leaflet.install(this);
                } else {
                    Leaflet.install(this, settings);
                }
            }
        }

        @Override
        public Class<? extends Page> getHomePage() {
            return Page.class;
        }
    };
}
 
開發者ID:DrunkenPandaFans,項目名稱:wicket-leaflet,代碼行數:22,代碼來源:LeafletTest.java

示例15: createApplication

import org.apache.wicket.protocol.http.WebApplication; //導入依賴的package包/類
/**
 * Creates new web application instance with installed Leaflet library.
 * Application is configured by overriding different methods in this class,
 * e.g. you can configure Leaflet  by overriding {@link #getSettings() } method.
 *
 * @return new web application instace with installed Leaflet.
 */
private WebApplication createApplication() {
    final LeafletSettings settings = getSettings();
    return new WebApplication() {

        @Override
        protected void init() {
            super.init();
            // create based on settings
            Leaflet.install(this, settings);

            // execute children init setup
            AbstractLeafletTest.this.init(this);
        }

        @Override
        public Class<? extends Page> getHomePage() {
            return AbstractLeafletTest.this.getHomePage();
        }
    };
}
 
開發者ID:DrunkenPandaFans,項目名稱:wicket-leaflet,代碼行數:28,代碼來源:AbstractLeafletTest.java


注:本文中的org.apache.wicket.protocol.http.WebApplication類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。