java类库详细讲解
源代码在线查看: emitxml.html
Generating an XML Document from a JSP Page
(Java Developers Almanac Example)
BODY CODE {font-family: Courier, Monospace; font-size: 11pt} TABLE, BODY {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt} PRE {font-family: Courier, Monospace; font-size: 10pt} H3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11pt} A.eglink {text-decoration: none} A:hover.eglink {text-decoration: underline} -->
The Java Developers Almanac 1.4
Order this book from Amazon.
Home
>
List of Packages
>
javax.servlet.jsp
[18 examples]
>
Java Server Pages Headers
[3 examples]
e1062.
Generating an XML Document from a JSP Page
This example demonstrates how to generate an XML document using a JSP
page. The page directive is used to set the content type.
<%-- Set the content type --%>
<%@ page contentType="text/xml" %>
<%-- Emit some XML --%>
<?xml version="1.0" encoding="UTF-8"?>
<map>
<entry key="key1" value="value1" />
<entry key="key2" />
</map>
Related Examples
e1060.
Getting a Request Header in a JSP Page
e1061.
Implementing a Redirect in a JSP Page
See also:
Java Server Pages
Java Server Pages Input
Java Server Pages Output
© 2002 Addison-Wesley.