1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.modules.actions;
18
19
20 import java.util.Enumeration;
21
22
23 import org.apache.jetspeed.util.URILookup;
24
25
26 import org.apache.turbine.modules.Action;
27 import org.apache.turbine.util.RunData;
28
29 /***
30 * Marks the referer page to enable buttons as "back"
31 *
32 * @author <A HREF="shesmer@raleigh.ibm.com">Stephan Hesmer</A>
33 */
34 public class MarkRefPage extends Action
35 {
36 public void doPerform( RunData data ) throws Exception
37 {
38 Enumeration enum = data.getRequest().getHeaderNames();
39 while (enum.hasMoreElements()) {
40 String name = (String)enum.nextElement();
41 if ("referer".equalsIgnoreCase(name)) {
42
43
44 String uri = data.getRequest().getHeader(name);
45 if (uri!=null) {
46
47 if (uri.indexOf(";jsessionid")!=-1) {
48 uri = uri.substring(0,uri.indexOf(";jsessionid"));
49 }
50
51 uri = data.getResponse().encodeURL( uri );
52 URILookup.markPage( uri, data);
53 }
54 break;
55 }
56 }
57 }
58
59 }