1 package org.apache.turbine.modules.screens.error; 2 3 18 19 import org.apache.ecs.ConcreteElement; 20 import org.apache.ecs.ElementContainer; 21 22 import org.apache.ecs.html.A; 23 24 import org.apache.turbine.modules.Screen; 25 import org.apache.turbine.util.RunData; 26 import org.apache.turbine.util.parser.ParameterParser; 27 import org.apache.turbine.util.uri.TurbineURI; 28 29 44 public class InvalidState 45 extends Screen 46 { 47 53 public ConcreteElement doBuild(RunData data) 54 throws Exception 55 { 56 ElementContainer body = new ElementContainer(); 57 ElementContainer message = new ElementContainer(); 58 59 StringBuffer sb = new StringBuffer (); 60 sb.append("<b>There has been an error.</b>") 61 .append("<p>") 62 .append("- If you used the browser \"Back\" or \"Reload\"") 63 .append(" buttons please use the navigation buttons we provide") 64 .append(" within the screen.") 65 .append("<p>") 66 .append("Please click "); 67 68 message.addElement(sb.toString()); 69 ParameterParser pp; 70 pp = (ParameterParser) data.getUser().getTemp("prev_parameters"); 71 pp.remove("_session_access_counter"); 72 73 TurbineURI back = new TurbineURI(data,(String ) data.getUser().getTemp("prev_screen")); 74 back.addPathInfo(pp); 75 message.addElement(new A().setHref(back.getRelativeLink()).addElement("here")); 76 77 message.addElement(" to return the the screen you were working on."); 78 79 body.addElement(message); 80 return body; 81 } 82 } 83 | Popular Tags |