1 package org.apache.turbine.modules.screens.error;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import org.apache.fulcrum.parser.ParameterParser;
25 import org.apache.turbine.modules.Screen;
26 import org.apache.turbine.pipeline.PipelineData;
27 import org.apache.turbine.util.RunData;
28 import org.apache.turbine.util.uri.TurbineURI;
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 public class InvalidState implements Screen
47 {
48
49
50
51
52
53
54 @Override
55 public String doBuild(PipelineData pipelineData)
56 throws Exception
57 {
58 RunData data = pipelineData.getRunData();
59 StringBuilder body = new StringBuilder();
60 body.append("<body>");
61
62 StringBuilder message = new StringBuilder();
63 StringBuilder sb = new StringBuilder();
64 sb.append("<b>There has been an error.</b>")
65 .append("<p>")
66 .append("- If you used the browser \"Back\" or \"Reload\"")
67 .append(" buttons please use the navigation buttons we provide")
68 .append(" within the screen.")
69 .append("<p>")
70 .append("Please click ");
71
72 message.append(sb.toString());
73 ParameterParser pp;
74 pp = (ParameterParser) data.getUser().getTemp("prev_parameters");
75 pp.remove("_session_access_counter");
76
77 TurbineURIuri/TurbineURI.html#TurbineURI">TurbineURI back = new TurbineURI(data,(String) data.getUser().getTemp("prev_screen"));
78 back.addPathInfo(pp);
79 message.append( "<a href=\"" ).append(back.getRelativeLink()).append("\">here</a>");
80 message.append(" to return the the screen you were working on.");
81
82 body.append(message);
83 body.append("</body>");
84 return body.toString();
85 }
86 }