tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gillespie59 <emmanuel.de...@atosorigin.com>
Subject Re: JavaScript Stack aggregator
Date Thu, 03 Mar 2011 08:06:56 GMT
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) {
		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);



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

View raw message