Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/obinary/cms/taglibs/util/Xmp.java


1   /**
2    *
3    * Magnolia and its source-code is licensed under the LGPL.
4    * You may copy, adapt, and redistribute this file for commercial or non-commercial use.
5    * When copying, adapting, or redistributing this document in keeping with the guidelines above,
6    * you are required to provide proper attribution to obinary.
7    * If you reproduce or distribute the document without making any substantive modifications to its content,
8    * please use the following attribution line:
9    *
10   * Copyright 1993-2003 obinary Ltd. (http://www.obinary.com) All rights reserved.
11   *
12   * */
13  
14  
15  
16  
17  
18  package com.obinary.cms.taglibs.util;
19  
20  import com.obinary.cms.util.Resource;
21  import com.obinary.cms.core.Content;
22  import com.obinary.cms.core.Atom;
23  
24  import javax.servlet.jsp.tagext.TagSupport;
25  import javax.servlet.jsp.tagext.BodyTagSupport;
26  import javax.servlet.jsp.JspWriter;
27  import javax.servlet.http.HttpServletRequest;
28  import javax.jcr.PropertyType;
29  import java.util.Locale;
30  import java.text.SimpleDateFormat;
31  
32  
33  /**
34   * Date: Apr 28, 2003
35   * Time: 11:20:59 AM
36   * @author Marcel Salathe
37   * @version 1.0
38   */
39  
40  
41  public class Xmp extends BodyTagSupport{
42  
43  
44      public int doEndTag() {
45          JspWriter out = pageContext.getOut();
46          String xmpString = getBodyContent().getString();
47          try {
48              xmpString = changeToXmp(xmpString);
49              out.print(xmpString);
50          }
51          catch (Exception e) {
52              e.printStackTrace();
53          }
54          return EVAL_PAGE;
55      }
56  
57      private String changeToXmp(String string) {
58          string = string.replaceAll("<","&lt;");
59          string = string.replaceAll(">","&gt;");
60          return string;
61      }
62  
63  }