Import statement for user defined package/class gives compile error and browser error. Same import statement works fine for java packages but not other. I have a simple jsp file in which I am only trying to import a java class I made to test. The jave class is created under src and in a package: src->org.easy->TryThis.java. The jsp file runs without any issues if I import any java util package but the moment I try to import my own package.class. It give me error 500 http - unable to compile and on the console it says "TryThis cannot be resolved to a type" : "TryThis is my class". I tried pasting jar file in web-inf lib, I tried many other solutions from different forums but nothing works. When making the import statement, it lets me auto fill the path to my java class though as if it can read my class in the path. The closest I got it to working is if in the import statement I say "<%@ page import="org.easy.*" %>, the errors vanishes on browser and console but if I try to then access the class and use its fields than errors come back. Can someone help... Thank you in advance
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<!-- This class will show how to import packages and classes -->
<!-- 1. importing a package -->
<%@ page import="org.easy.TryThis" %>
<% out.println(""); %>
</body>
</html>