Example usage for org.apache.commons.lang StringEscapeUtils escapeHtml

List of usage examples for org.apache.commons.lang StringEscapeUtils escapeHtml

Introduction

In this page you can find the example usage for org.apache.commons.lang StringEscapeUtils escapeHtml.

Prototype

public static String escapeHtml(String input) 

Source Link

Usage

From source file:gov.nih.nci.ncicb.cadsr.contexttree.CDEBrowserTree.java

public DefaultMutableTreeNode getTree(Hashtable params) throws Exception {
    treeType = StringEscapeUtils.escapeHtml((String) params.get("treeType"));

    functionName = StringEscapeUtils.escapeHtml((String) params.get("functionName"));
    contextExcludeListStr = StringEscapeUtils
            .escapeHtml((String) params.get(TreeConstants.BR_CONTEXT_EXCLUDE_LIST_STR));
    return buildTree(params);
}

From source file:ch.systemsx.cisd.openbis.generic.shared.translator.TypeTranslator.java

private static <T extends AbstractType> T fill(T type, AbstractTypePE typePEOrNull) {
    if (typePEOrNull != null) {
        type.setCode(StringEscapeUtils.escapeHtml(typePEOrNull.getCode()));
        type.setDescription(StringEscapeUtils.escapeHtml(typePEOrNull.getDescription()));
    }/*from w  ww.ja  va 2s.co  m*/
    return type;
}

From source file:com.cruta.hecas.socket.NotifyView.java

public void notificarPUSH() {

    String summary = "Nuevo Elemento";
    String detail = "Se agrego a la lista";
    String CHANNEL = "/notify";

    EventBus eventBus = EventBusFactory.getDefault().eventBus();
    eventBus.publish(CHANNEL,/*  w ww.ja  v a 2 s.  com*/
            new FacesMessage(StringEscapeUtils.escapeHtml(summary), StringEscapeUtils.escapeHtml(detail)));
}

From source file:bboss.org.apache.velocity.app.event.implement.EscapeHtmlReference.java

/**
 * Escape all HTML entities./*from www .  ja v  a 2s  . c o m*/
 * 
 * @param text
 * @return An escaped String.
 * @see <a href="http://jakarta.apache.org/commons/lang/api/org/apache/commons/lang/StringEscapeUtils.html#escapeHtml(java.lang.String)">StringEscapeUtils</a>
 */
protected String escape(Object text) {
    return StringEscapeUtils.escapeHtml(text.toString());
}

From source file:ch.entwine.weblounge.cache.impl.filter.SpecialChars.java

/**
 * @see ch.entwine.weblounge.api.request.StreamFilter#filter(java.lang.StringBuffer,
 *      java.lang.String)/*ww  w .  jav a  2s  . c om*/
 */
public StringBuffer filter(StringBuffer buffer, String contentType) {
    if ("text/html".equals(contentType))
        return new StringBuffer(StringEscapeUtils.escapeHtml(buffer.toString()));
    return buffer;
}

From source file:com.redhat.rhn.frontend.action.satellite.CatalinaAction.java

/** {@inheritDoc} */
public ActionForward execute(ActionMapping mapping, ActionForm formIn, HttpServletRequest request,
        HttpServletResponse response) {/*w  ww  . j  ava  2 s . c  om*/
    String catalinaBase = System.getProperty("catalina.base");
    String contents = FileUtils.getTailOfFile(catalinaBase + "/logs/catalina.out", 1000);
    contents = StringEscapeUtils.escapeHtml(contents);
    request.setAttribute("contents", contents);
    return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
}

From source file:eionet.cr.web.util.columns.GenericColumn.java

@Override
public String format(Object object) {

    if (object instanceof HarvestSourceDTO && actionBean instanceof HarvestSourcesActionBean) {

        return "<input type='checkbox' value='"
                + StringEscapeUtils.escapeHtml(((HarvestSourceDTO) object).getUrl()) + "' name='sourceUrl'/>";
    }//www.  ja va2s . c  om
    return "";
}

From source file:com.activecq.api.helpers.DesignHelper.java

/**
 * Returns an link tag for the css path supplied in the media indicator.
 *
 * @param path/*from  ww w  .j av a  2 s. c  o  m*/
 * @param page
 * @param attrs
 * @return
 */
public static String cssTag(String path, Page page, String media) {
    String src = cssSrc(path, page);

    if (StringUtils.isBlank(src)) {
        return "<!-- Missing CSS : " + path + ".css -->";
    }

    if (StringUtils.isBlank(media)) {
        media = DEFAULT_CSS_MEDIA_TYPE;
    }

    media = StringEscapeUtils.escapeHtml(media);
    src = StringEscapeUtils.escapeHtml(src);

    // Begin writing link tag
    return "<link rel=\"stylesheet\" media=\"" + media + "\" href=\"" + src + "\" />";
}

From source file:de.voolk.marbles.web.app.render.SimplePageRenderer.java

private void init() {
    setLinkResolver(new PageLinkResolver(getUrlResolver(), getPageSession()));

    addContentFilter(new IContentFilter() {
        @Override/*from  w ww .  j av  a 2  s.co m*/
        public String filter(String original) {
            return StringEscapeUtils.escapeHtml(original);
        }
    });
    addContentFilter(new IContentFilter() {
        @Override
        public String filter(String content) {
            StringBuilder result = new StringBuilder();

            int count = 0;
            String[] parts = content.split("\\$\\$\\$");
            for (String part : parts) {
                if (count % 2 == 0) {
                    result.append(part.replace("\n", "\n<br/>\n"));
                } else {
                    result.append("<pre>").append(part).append("</pre>");
                }
                count++;
            }
            return result.toString();
        }
    });
    addContentFilter(new ExternalLinkFilter());
}

From source file:com.devbliss.doctest.items.RequestUploadDocItem.java

public String getHtmlEscapedFileBody() {
    return StringEscapeUtils.escapeHtml(fileBody);
}