Response.Write with JSP

Clearly, there’s a trend here. I’m trying to ramp up with some basic JSP knowledge and the quickest way I know how is by displaying error messages or attempting to debug my learning code.

In classic ASP or C#, the use of Response.Write is quite common, in JSP, you can write to the screen or the server log using the following example:

<% System.out.println("Error on line 1"); out.println("Error on line 1"); %>

Using JSP to display System Properties from a Remote Server

Save the following file as index.jsp and it should display the system properties.

Date: <%= new java.util.Date() %>

Java Version: <%= System.getProperty("java.version") %>

Java Home: <%= System.getProperty("java.home") %>

Java Vendor: <%= System.getProperty("java.vendor") %>

Java Vendor URL: <%= System.getProperty("java.vendor.url") %>

OS Architecture: <%= System.getProperty("os.arch") %>

OS Name: <%= System.getProperty("") %>

User Name: <%= System.getProperty("") %>

User Home: <%= System.getProperty("user.home") %>

User Directory: <%= System.getProperty("user.dir") %>