Java Reference
In-Depth Information
<%@ taglib uri="http://jakarta.apache.org/taglibs/mailer-1.1"
prefix="mailer" %>
IDEA
searches
JAR
s from the module's Classpath for the .tld file containing the
tag
<uri>http://jakarta.apache.org/taglibs/mailer-1.1<uri>
. In version 5.0
of
IDEA
, the search is also performed for separate .tld files in registered web
resource directories.
<%@ taglib uri="taglibs-string.jar" prefix="string" %>
IDEA
searches for taglibs-string.jar file in the module's Classpath and then looks
for
META-INF
/taglib.tld in it.
The prefix attribute's value is arbitrary but required: It provides a label for
identifying which library a tag is associated with. You use this prefix throughout
the page to reference tags in this particular library.
Some tag libraries, such as those provided with the Apache Struts pack-
age and JSTL, rely on runtime reflection to resolve the names and values
of properties and JavaBeans in the page.
IDEA
has no way to accurately
determine whether they're being used appropriately, beyond verifying
that all required attributes have been satisfied.
WARNING
11.1.7
Implementing an ACME web application
Let's put a web interface on top of the currency converter. The application is
simplistic: You'll implement a
JSP
form that gathers the required data for per-
forming a currency conversion and a single
JSP
that is responsible for returning
the results.
The entry
JSP
should briefly explain its purpose and then provide an
HTML
form that the user can fill out to provide the data for the conversion. According to
the
API
, this data includes the starting currency, the ending currency, and the
amount of currency to be exchanged. Using the
Project
tool window, create a new
JSP
called index.jsp under the resources folder of your
ACME
web application web
module. Edit it as shown in listing 11.1.
Listing 11.1
The static elements of a simple JSP page that presents an HTML form
to the user
<html>
<head>
<title>ACME Currency Converter</title>
</head>
<body>
<h1>ACME Currency Converter</h1>