You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Gillespie59 <em...@atosorigin.com> on 2011/03/03 09:06:56 UTC

Re: JavaScript Stack aggregator

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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org