response The servlet response, an HttpServletResponseobject out The

response The servlet response, an HttpServletResponseobject out The output writer, a PrintWriterobject in The input reader, a BufferedReaderobject Example 2-6 shows a simple JSP page that says ‘’Hello” in a manner similar to Example 2-2, though with a lot less code. It makes use of the predefined requestand outvariables. * An earlier technology, called Page Compilation, uses and tags and a different internal syntax. Page Compilation has been deprecated in favor of JavaServer Pages. If you have a server that supports JavaServer Pages and want to test this page, you should place the file under the server’s document root (probably server_root/public_html) and save it with a special extension. By default, this extension for JSP pages is .jsp. Assuming you have saved the page as hello1.jsp, you can then access it at the URL http://server:port/hello1.jsp. A screen shot is shown in Figure 2-11. Example 2-6. Saying Hello with JSP Hello

<% if (request.getParameter( name ) == null) { out.printIn( Hello World ); } else { out.printIn( Hello, + request.getParameter( name )); } %>

Figure 2-11. Saying Hello using JavaServer Pages Behind the Scenes
Note: If you are looking for cheap and quality provider to host and run your java application check Astra java hosting services

Comments are closed.