My linux world » Java Spring – Jstl tag

Java Spring - Jstl tag


Contents

Prerequistes

Please read : Java spring – quickstart

Configuration

tag

create the following tag in src/main/webapp/WEB-INF/tags/displayHello.tag :

<%@tag description="mytag description" pageEncoding="UTF-8"%>
<%@attribute name="message" type="java.lang.String" required="true" %>
 
display message from tag : ${message}

How to use it

In your jsp file, import it :

<%@taglib prefix="template" tagdir="/WEB-INF/tags" %>

Then you can call it :

<template:displayHello message="hello world !!"></template:displayHello>

Copyright © 2024 My linux world - by Marc RABAHI
Design by Marc RABAHI and encelades.