Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6095059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:46:13+00:00 2026-05-23T12:46:13+00:00

I am using wicket 1.5.x and trying to load a css file which will

  • 0

I am using wicket 1.5.x and trying to load a css file which will be shared by all the pages,panels,forms. Right now when I statically add a css file (located in [app]/WebApps/style) directory in my BasePage and extend other pages.

Now if I want to use this css file for a panel,it does not get any class/id selector when I add a css class into that file for a panel .Neither the CSS file is attached to html head of BasePage. So Instead I wanted to use a global css file. I have tried to do like this:

In my Application class I did like this by calling the following function in init(),

 private void mountResources(){
    mountResource("/css/layout.css", Resources.CSS_BASE);
}

where my Resource class is,

public abstract class Resources {

public static final ResourceReference CSS_BASE 
 = new  CssResourceReference(OrbitApplication.class, "resources/layout.css"); 

}

Here my css is in main/resource/ directory(maven structure). But the css is not loading. I have heared about HeaderContributor but did not find how to use in my wicket 1.5 appllication.

Any idea/snippet of how to do this? help appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:46:13+00:00Added an answer on May 23, 2026 at 12:46 pm

    Use

    MyApp.init() {
      super.init();
    
      org.apache.wicket.Application.getHeaderContributorListenerCollection().add(new IHeaderContributor() {
    
        public void renderHead(IHeaderResponse response) {
          response.renderCssReference(Resources.CSS_BASE);
        }
      });
    }
    

    Why don’t you read the responses to your questions in IRC ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to start a Wicket Application using Felix implementation of OSGi HTTP service,
I'm trying to migrate an application using OpenId4Java to Wicket 1.5. Using the migration
I am trying to develop a Wicket-based web application using Hibernate at the model
I have the next problem with wicket and standard error handling: all the css
I'm developing an e-commerce using Wicket to render pages. I have a BasePage with
I have a Wicket AuthenticatedWebApplication which has several pages and features that need to
I am using wicket framework, and I have made a zip file by Java
I'm trying to make a webapp using Scala and Apache Wicket and am not
I am currently working on a web app using Wicket and started using jQuery
We're creating a web system using Java and Servlet technology (actually Wicket for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.