I am experienced with Java programming and server-side scripting with PHP/CGI, but I am trying to pick up JSP. I know that you can use Java classes in JSP servles, but I am really struggling to find tips on HOW to include those classes and WHERE to place those class files.
Here is some code.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<%@ page import="java.util.*" %>
Date date = new Date();
TestClass t = new TestClass();
out.println("<p>The current time is "+ date +"</p>");
out.println("<p>IP: "+ request.getRemoteHost() +"</p>");
out.println("<p>Test:"+ t.Test() +"</p>");
I wrote and compiled a simple class called TestClass with two methods--a constructor (that does nothing) and the Test() method (which returns a string). Where should I put this class file and is there anything else I should know to make it work?