Overview | Package | Class | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--javax.servlet.http.HttpServlet | +--com.ibm.XMLEnabler.XMLEnabler
This servlet transforms an XML document using a particular XSL stylesheet. The stylesheet used is determined by two factors:
Currently the XML document is passed in as a parameter (URL=) in the URL itself. This document is parsed, the appropriate XSL stylesheet is parsed, then the two documents are combined. The results of the transformation are returned via HTTP to the caller.
This URL invokes the servlet and returns a transformed XML document:
http://localhost:8080/servlet/com.ibm.XMLEnabler.XMLEnabler?URL=http://localhost/testdata.xml
The property file can include three types of parameters:
Here's a sample file format:
Default=http://localhost/xmLDAP01.xsl Order=MSIE/Opera/Lynx/Mozilla MSIE=http://localhost/xmLDAP01.xsl Opera=http://localhost/xmLDAP02.xsl Lynx=http://localhost/xmLDAP03.xsl Mozilla=http://localhost/hlist.xsl
This file defines the default stylesheet, the order in which browser
types should be searched, and stylesheets for browsers whose HTTP
headers include the strings "MSIE
" (Internet Explorer),
"Opera
," "Lynx
," and "Mozilla
"
(Netscape). It is significant in this example that "MSIE
"
is queried before "Mozilla
," because both Internet Explorer
and Netscape contain the string "Mozilla
" in their HTTP
headers.
Method Summary | |
void | service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
The service method responds to an HTTP request. |
Methods inherited from class javax.servlet.http.HttpServlet | |
doDelete, doGet, doOptions, doPost, doPut, doTrace, getLastModified, service, service |
Methods inherited from class javax.servlet.GenericServlet | |
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, init, log, service |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Method Detail |
public void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, java.net.MalformedURLException
service
method responds to an HTTP request.
req
- HttpServletRequest that encapsulates the request to the
servlet
resp
- HttpServletResponse that encapsulates the response from the
servletOverview | Package | Class | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |