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

  • SEARCH
  • Home
  • 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 427955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:37:39+00:00 2026-05-12T19:37:39+00:00

Currently, I have an Application which consists of a BasePage which as a header

  • 0

Currently, I have an Application which consists of a BasePage which as a header (panel), footer(panel) and in the center for inherited page content. The problem I am running into is with ResourceReferences (Perhaps this isn’t even the right way). I am looking for a solution which will allow me to do the following:

  1. Have a single directory for globally used images, js, css
  2. Register (or not) those resources so that they can be accessible from any inherited page or sibling pages to BasePage I might create in the future
  3. Allow those resources to be accessible within CSS and JS (e.g. urls to images)

So far I have read through several examples which show how to package resource for a component or application level scope, but none that seem to address all 3 issues I am looking for help with. It is critical that I don’t have to copy globally used images (edit icon, logos, etc) into each component package for referencing, and it would be nice for maintenance reasons that these bindings be made in one place globally for easy reference and updating.

  • 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-12T19:37:40+00:00Added an answer on May 12, 2026 at 7:37 pm

    This has changed significantly since Wicket 1.4. Please see ‘Adding Javascript or CSS using a Resource’ in Wicket’s Wiki

    To make images and other resources globally accessible (especially from CSS and JS files), mount them in your Applications’s init() method:

    mountSharedResource("/images/submit.jpg", new ResourceReference(MyComponent.class, "foo.jpg").getSharedResourceKey());
    

    There is absolutely no need to duplicate resources in any way. Resource don’t have to be in the same packages as the component itself. In our applications, we put globally used resources into a dedicated packages (say com.example.myapp.images) and put a single class in it (e.g. ImagesScope.java) – same for JS and CSS.

    For images, you won’t need ResourceReference as you won’t need those references rendered in your code (except for org.apache.wicket.markup.html.image.Image). For JS and CSS use

    add(CSSPackageResource.getHeaderContribution(PanelOne.class, "PanelOne.css"));
    

    By the way, I’m the author of a little library called wicketstuff-merged-resources available from GitHub. Using this library you may skip the manual mounting in your Application’s init() and use annotations instead.

    EDIT: updated link. unfortunately, documentation in the wicketstuff wiki seems to be gone now. There are some articles on our blog though.

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

Sidebar

Related Questions

I have an application in which I'm currently using a two column table in
I have a xPage application which shows list of emails of the currently logged
I currently have a 32-bit .Net application (on x86 Windows) which require lots of
I have a Clustered Windows Hosting site which currently hosts an MVC Web Application
I'm currently working on an oophp application. I have a site class which will
I have a small application which consists of a DAL, BLL and the Application
I have a class diagram for my application which consists of several compositions and
I have a c# .net 2.0 winforms application which consists basically of one form
I currently have an application which takes a screenshot of a presenter's desktop and
I have a Lotus Notes application which actually consists of a template with all

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.