I found the solution. 

I add the js files to my stack in the getJavaScriptLibraries method
depending of a parameter of my request.

public List getJavaScriptLibraries() {
                List  jsStack = new ArrayList();
                if (myRequest.getMyParam) {
                                jsStack.add(customMessages);
                }
                return jsStack;
}

But when the StackAssetRequestHandler service call this method, I lost this
parameter, so Tapestry include any file. My final JS file is empty. 

I extended the StackAssetRequestHandler class. I set again my param in the
handleAssetRequest method, depending of the desired Stack name.


    public boolean handleAssetRequest(Request request, Response response,
String extraPath) throws IOException
    {
   
        if(extraPath.endsWith("myStack.js")) myRequest.setMyParam(true);
                
        return super.handleAssetRequest(request, response, extraPath);
    }

Thanks

Emmanuel

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/JavaScript-Stack-aggregator-tp3403611p3407618.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to