본문 바로가기

JSP

애트리뷰트를 지원하는 태그파일

newLine.tag 파일 생성


<%@tag pageEncoding="utf-8" %>

<%@tag body-content="empty"%>

<%@attribute name="color" %>

<%@attribute name="size" type="java.lang.Integer" %>

<font color="${color}">

<%

    for(int cnt=0 ; cnt<size; cnt++){

         out.print("-");

    }

%>

</font>

<br />

 

 

<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>

 

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

 

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>Insert title here</title>

</head>

<body>

 

<util:newLine color="blue" size="25"/>

저녁메뉴<br />

<util:newLine color="red" size="20"/>

불고기 덮밥<br />

카레라이스<br />

쫄면<br />

<util:newLine color="blue" size="25"/>

 

</body>

</html>