Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ tag language="java" %>
- <%@ attribute name="color" required="false" %> <!-- the color attribute -->
- <%@ attribute name="size" required="false" %> <!-- the size attribute -->
- <%
- String varColor; //local variable for varcolor
- int varSize; //size variable
- try {
- varSize = Integer.parseInt(size); //parse the size arrtibute to integer
- }catch(Exception e) {varSize = 12;}
- if(color != null) varColor = color; //if color has a value set varcolor to color
- else varColor = "black"; //if it is null
- %>
- <h1 style="color:<%=varColor%>;font-size:<%=varSize%>px;">hello there from jsp tag</h1>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement