We do something like this for our T5.4 stack:

    @Inject
    @Path( "classpath:META-INF/assets/css/font-awesome.css" )
    private Asset fontAwesomeStylesheet;

...

 public List<StylesheetLink> getStylesheets()
    {
        List<StylesheetLink> stylesheetLinks = new
ArrayList<StylesheetLink>();

        stylesheetLinks.add( new StylesheetLink( fontAwesomeStylesheet ) );
...

HTH

-- 
Chris



On Thu, Mar 20, 2014 at 12:26 PM, Michael Gentry <mgen...@masslight.net>wrote:

> I tried with getClasspathAsset() and 5.4B3, neither of which found the CSS
> under src/main/resources.  Is this a bug or should I just move the CSS to
> src/main/webapp?
>
> Thanks,
>
> mrg
>
>
>
> On Wed, Mar 19, 2014 at 6:49 PM, Michael Gentry <mgen...@masslight.net
> >wrote:
>
> > On Wed, Mar 19, 2014 at 5:56 PM, Thiago H de Paula Figueiredo <
> > thiag...@gmail.com> wrote:
> >
> >> On Wed, 19 Mar 2014 18:23:48 -0300, Michael Gentry <
> mgen...@masslight.net>
> >> wrote:
> >>
> >> Hi!
> >>
> >> Have you tried 5.4-beta-3? If not, please do it.
> >>
> >
> > Hi Thiago!
> >
> > I haven't tried 5.4B3 yet because I have to bootleg the JARs into work,
> > which is a hassle, but I can attempt to do so.  (Part of what I'm doing
> > with 5.4 is evaluating how difficult it'll be to migrate our large 5.3
> code
> > base in the future.)
> >
> >
> >  *  public List<StylesheetLink> getStylesheets()  {
>  List<StylesheetLink>
> >>>
> >>> stylesheets = new ArrayList<StylesheetLink>();    stylesheets.add(new
> >>> StylesheetLink(assetSource.getContextAsset("datatables/
> >>> css/dataTables.bootstrap.css",
> >>> null)));     return stylesheets;  }*
> >>>
> >>
> >> There you are getting an asset from the context (getContextAsset()),
> >> while in the @Import you're getting it from the classpath. Try
> >> getClasspathAsset() instead
> >
> >
> > I'll try getClasspathAsset() tomorrow.  I used getContextAsset() because
> > that's what we used in 5.3 and that's what the documentation mentions at
> > the bottom of https://tapestry.apache.org/javascript.html.  I thought
> the
> > general direction in 5.4 was to put CSS/JS/Modules under
> > src/main/resourcesMETA-INF instead of src/main/webapp and since @Import
> > worked, I figured the Stack would do the same.
> >
> > Thanks again,
> >
> > mrg
> >
> >
>

Reply via email to