"Hello, World!" Java ExtensionThis code snippet illustrates how to send a response to an HTTP request from a Java Extension. Hello, World!
public void doGet( HttpServletRequest req, HttpServletResponse res )
throws ServletException, IOException
{
res.setContentType( "text/html" );
PrintWriter out = res.getWriter();
out.println( "<h1>Hello, world!</h1>");
}
When you obtain the If you run this code from a request rule, all subsequent rules processing will terminate and the response will be sent directly back to the client. If you run this code from a response rule, it will modify the response data that was provided by the back-end server. Subsequent response rules will be run, and if they try to inspect the response data, they will see the response that was set by this code. Running the codeSee the Overview article, which describes how to create a Java source file from this code snippet. The Watermarking article describes how to compile and deploy an extension using an IDE like Eclipse, and the Java Development Guide contains a complete reference.
Owen Garrett
[Zeus Dev Team] 01 July 2008
|
Recent Articles
Other Resources
|


