You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by infiniter <in...@gmail.com> on 2014/03/05 00:23:21 UTC

css and js files in subproject

hi,
I got a Wicket application set up with Maven. It has a sub project (jar
type) with all the assets. How can I load them in my application?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/css-and-js-files-in-subproject-tp4664775.html
Sent from the Users forum 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


Re: css and js files in subproject

Posted by Martin Grigorov <mg...@apache.org>.
It should be possible.
See how PackageResourceReference looks up the asset by using the 'scope'
class to load it as a resource.
You can roll your own resource reference that loads from the class path:
AnyClass.class.getClassLoader().getResource("/some/absolute/path/my.css")

Martin Grigorov
Wicket Training and Consulting


On Wed, Mar 5, 2014 at 5:55 PM, infiniter <in...@gmail.com> wrote:

> Sorry, I forgot to mention that there are no Java classes inside that
> project, so is it even possible to reference those assets?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/css-and-js-files-in-subproject-tp4664775p4664799.html
> Sent from the Users forum 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
>
>

Re: css and js files in subproject

Posted by infiniter <in...@gmail.com>.
Sorry, I forgot to mention that there are no Java classes inside that
project, so is it even possible to reference those assets?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/css-and-js-files-in-subproject-tp4664775p4664799.html
Sent from the Users forum 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


Re: css and js files in subproject

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Load them as if they were in the same project.
PackageResourceReference loads the assets from the classpath so it doesn't
matter in which .jar they are.

Martin Grigorov
Wicket Training and Consulting


On Wed, Mar 5, 2014 at 1:23 AM, infiniter <in...@gmail.com> wrote:

> hi,
> I got a Wicket application set up with Maven. It has a sub project (jar
> type) with all the assets. How can I load them in my application?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/css-and-js-files-in-subproject-tp4664775.html
> Sent from the Users forum 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
>
>