You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by th...@apache.org on 2008/10/27 15:06:32 UTC
svn commit: r708187 -
/forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/Key.java
Author: thorsten
Date: Mon Oct 27 07:06:32 2008
New Revision: 708187
URL: http://svn.apache.org/viewvc?rev=708187&view=rev
Log:
Adding simple key generating class that can be use in the jx template like: 'jx:cache-key="${Packages.org.apache.forrest.dispatcher.impl.helper.Key(cocoon.request).toString()}"'
Added:
forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/Key.java (with props)
Added: forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/Key.java
URL: http://svn.apache.org/viewvc/forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/Key.java?rev=708187&view=auto
==============================================================================
--- forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/Key.java (added)
+++ forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/Key.java Mon Oct 27 07:06:32 2008
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.forrest.dispatcher.impl.helper;
+
+import java.io.Serializable;
+
+import org.apache.cocoon.environment.http.HttpRequest;
+
+public class Key implements Serializable{
+ /**
+ * serialVersionUID
+ */
+ private static final long serialVersionUID = 1L;
+ private String key;
+
+ public Key(HttpRequest request) {
+
+ key = request.getRequestURI();
+
+ if (null != request.getQueryString()){
+ key=key+request.getQueryString();
+ }
+ }
+ public String toString(){
+ return key;
+ }
+}
\ No newline at end of file
Propchange: forrest/branches/dispatcher_rewrite/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/impl/helper/Key.java
------------------------------------------------------------------------------
svn:eol-style = native