Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 865 Bytes

README.md

File metadata and controls

38 lines (30 loc) · 865 Bytes

Slugify JSTL Integration

Usage

If you want to use Slugify in your JSPs you need the JSTL Integration and the library itself. Here's the dependency information for Maven:

<dependency>
	<groupId>com.github.slugify</groupId>
	<artifactId>slugify-integration-jstl</artifactId>
	<version>2.4</version>
</dependency>

Now you're able to use it:

<%@ taglib prefix="slg" uri="http://github.com/slugify" %>
<!-- Result: hello-world -->
${slg:slugify('Hello, world!')}

You can configure Slugify this way (JSTL):

<%@ taglib prefix="slg" uri="http://github.com/slugify" %>
<slg:init lowerCase="false" underscoreSeparator="true" />
<!-- Result: Hello_world -->
${slg:slugify('Hello, world!')}

Or this way (Java):

InitSlugifyTag.getSlugify().withLowerCase(false).withUnderscoreSeparator(true);