Can someone please walk me through the process of loading a class or package in JSP with Tomcat?
I think it might just be a Tomcat setup issue :S my JSP file runs fine without importing or using dbpool or dbpooljar. I've tried many suggestions to other peoples similar issues without any luck. Any help would be apreciated!
My class/package placed in web-inf/classes (among other places)
package dbpooljar; public class DBPool { public DBPool() { System.out.println("dbpool evidence!"); } } My compile commands
javac "C:\website\apache-tomcat-6.0.18\webapps\ROOT\WEB-INF\classes\dbpool.java" jar cf "C:\website\apache-tomcat-6.0.18\webapps\ROOT\WEB-INF\classes\dbpooljar.jar" DBPool.java My index.jsp
<%@ page import="java.sql.*,java.util.List,java.util.ArrayList,DBPool" %> <html> <body> Getting Length of a String <% String s1 = "Length of a String!"; out.println("\"" + s1 + "\"" + " is of " + s1.length() + " characters "); DBPool test=new DBPool(); %> </body> </html> And lastly my horrible error (among others when I've tried different things)
An error occurred at line: 9 in the generated java file The import DBPool cannot be resolved