You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Wilko Hische <w....@dotmachine.nl> on 2007/11/21 16:00:57 UTC

Proper way to mount a shared resource

Hi,

This probably is a stupid question, but thusfar i couldn't figure it out.

I would like to mount a shared resource, but I don't know how to get/create
the correct resourceKey.

In a Quickstart for Wicket 1.3.0-rc1 i put the following init method in
WicketApplication:

	@Override
	protected void init() {
		final String resourceName = "myResource";
		
		getSharedResources().add( resourceName, new Resource() {

			@Override
			public IResourceStream getResourceStream() {
				return new StringResourceStream( "Found!" );
			}
			
		});
		
		mountSharedResource("/resource", resourceName);
	}

When requesting
  http://localhost:8080/resource
in my browser the message
  ERROR - haredResourceRequestTarget - shared resource myResource not found
appears in my log.

When i mount like this:
  mountSharedResource("/resource", "org.apache.wicket.Application/" +
resourceName);
the resource is correctly shown in the browser.

My question is, what is the proper way to get the resourcekey for this
resource?

Regards,

Wilko Hische
-- 
View this message in context: http://www.nabble.com/Proper-way-to-mount-a-shared-resource-tf4850639.html#a13878724
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org