1 6 7 package com.quikj.application.web.talk.jspbeans; 8 9 import javax.servlet.http.*; 10 import javax.servlet.jsp.*; 11 import java.io.*; 12 13 17 public class ChatAccessFormTag extends javax.servlet.jsp.tagext.TagSupport 18 { 19 20 21 private String type; 22 23 24 public ChatAccessFormTag() 25 { 26 } 27 28 public int doStartTag() 29 { 30 try 31 { 32 JspWriter out = pageContext.getOut(); 33 HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); 34 String context = request.getContextPath(); 35 String customer = null; 36 if (request.getAttribute("customerProperty") != null) 37 { 38 customer = ((ContactCenterCustomerProperty)request.getAttribute("customerProperty")).getCustomer(); 39 } 40 41 if (type.equals("unrestricted") == true) 42 { 43 out.println("<form action=\"" 44 + context 45 + "/servlet/ContactCenterUserInfoServlet\">"); 46 out.println("<input type=\"HIDDEN\" name=\"customer\" value=\"" 47 + customer + "\">"); 48 } 49 else if (type.equals("restricted") == true) 50 { 51 out.println("<form action=\"" 52 + context 53 + "/servlet/ContactCenterAuthenticatorServlet\">"); 54 out.println("<input type=\"HIDDEN\" name=\"customer\" value=\"" 55 + customer + "\">"); 56 } 57 else if (type.equals("email") == true) 58 { 59 out.println("<form action=\"" 60 + context 61 + "/servlet/ContactCenterEmailServlet\">"); 62 out.println("<input type=\"HIDDEN\" name=\"customer\" value=\"" 63 + customer + "\">"); 64 } 65 66 } 67 catch (IOException ex) 68 { 69 return SKIP_PAGE; 70 } 71 72 return EVAL_BODY_INCLUDE; 73 } 74 75 public int doEndTag() 76 { 77 try 78 { 79 JspWriter out = pageContext.getOut(); 80 81 out.println("</form>"); 82 } 83 catch (IOException ex) 84 { 85 return SKIP_PAGE; 86 } 87 return EVAL_PAGE; 88 } 89 90 94 public String getType() 95 { 96 return this.type; 97 } 98 99 103 public void setType(String type) 104 { 105 this.type = type; 106 } 107 108 } 109 | Popular Tags |