Author: chris.laprun(a)jboss.com
Date: 2010-08-05 09:14:29 -0400 (Thu, 05 Aug 2010)
New Revision: 3759
Modified:
components/pc/trunk/samples/src/main/java/org/gatein/pc/samples/remotecontroller/RemoteControllerPortlet.java
Log:
- Properly set cache level to ResourceURL.PAGE as mandated by JSR 286 for resource-serving
portlets which resources generate URLs.
Modified:
components/pc/trunk/samples/src/main/java/org/gatein/pc/samples/remotecontroller/RemoteControllerPortlet.java
===================================================================
---
components/pc/trunk/samples/src/main/java/org/gatein/pc/samples/remotecontroller/RemoteControllerPortlet.java 2010-08-05
12:51:22 UTC (rev 3758)
+++
components/pc/trunk/samples/src/main/java/org/gatein/pc/samples/remotecontroller/RemoteControllerPortlet.java 2010-08-05
13:14:29 UTC (rev 3759)
@@ -1,5 +1,24 @@
/*
- * Copyright (c) 2008, Your Corporation. All Rights Reserved.
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
package org.gatein.pc.samples.remotecontroller;
@@ -32,6 +51,8 @@
String namespace = "n_" + renderResponse.getNamespace();
printWriter.print("<p><a href='#' onclick=\"" +
namespace + "_remote=" + namespace + "_openRemote('");
ResourceURL resource = renderResponse.createResourceURL();
+ // set the cache level to PAGE since the resource creates URLs and the spec
mandates PAGE cache level in that case
+ resource.setCacheability(ResourceURL.PAGE);
printWriter.print(resource);
printWriter.print("')\">Open remote
control!</a></p>");
}