J
JStrummer
I am writing my first page in JSP and am trying to get my arms around
custom tag libraries.
What I'd like to do is mimic an ASP-type subroutine here, where I call
a subroutine, pass in a parameter, and output HTML code. For instance,
in ASP, writePageTitle("My homepage") would yield <TITLE>My
homepage</TITLE>.
I am having problems passing the parameter to a tag file in JSP. Here
is what I have. I would appreciate any pointers, and, if I am going
about this the wrong way, I am very, very open to suggestion. Thanks
in advance.
index.jsp
==================
<HTML>
<HEAD>
<c:set var="PageKeywords" value="Home, Homepage, Main Page" />
<c:set var="PageTitle" value="Home" />
<%@ taglib prefix="HTMLTitle"
tagdir="/WEB-INF/tags" %>
<HTMLTitle:html_title/ PageTitle="<%=PageTitle%>">
and so on....
html_title.tag
===================
<%
out.println("<TITLE>${PageTitle}</TITLE>");
%>
custom tag libraries.
What I'd like to do is mimic an ASP-type subroutine here, where I call
a subroutine, pass in a parameter, and output HTML code. For instance,
in ASP, writePageTitle("My homepage") would yield <TITLE>My
homepage</TITLE>.
I am having problems passing the parameter to a tag file in JSP. Here
is what I have. I would appreciate any pointers, and, if I am going
about this the wrong way, I am very, very open to suggestion. Thanks
in advance.
index.jsp
==================
<HTML>
<HEAD>
<c:set var="PageKeywords" value="Home, Homepage, Main Page" />
<c:set var="PageTitle" value="Home" />
<%@ taglib prefix="HTMLTitle"
tagdir="/WEB-INF/tags" %>
<HTMLTitle:html_title/ PageTitle="<%=PageTitle%>">
and so on....
html_title.tag
===================
<%
out.println("<TITLE>${PageTitle}</TITLE>");
%>