Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Maven Central javadoc jooby-unbescape website

unbescape

Unbescape is a Java library aimed at performing fully-featured and high-performance escape and unescape operations for: HTML, JavaScript and lot more.

dependency

<dependency>
 <groupId>org.jooby</groupId>
 <artifactId>jooby-unbescape</artifactId>
 <version>1.4.1</version>
</dependency>

exports

  • html escaper.
  • js escaper.
  • json escaper.
  • css escaper.
  • uri escaper.
  • queryParam escaper.
  • uriFragmentId escaper.

usage

{
  use(new XSS());

  post("/", req -> {
    String safeHtml = req.param("text", "html").value();
  });

}

Nested context are supported by providing multiple encoders:

{
  use(new XSS());

  post("/", req -> {
    String safeHtml = req.param("text", "js", "html", "uri").value();
  });

}

Encoders run in the order they are provided.