1. I developed a class with a static method. The method is called "CheckFlow()" and returns String.
That class is using another jar files and dlls, that located inside the same project.
I put that class in a new package called "Hasp" (not in the default package), made it public class, and
gave it a name begining with Capital letter - HaspDemo.
2. I generated out of the project that contains that class a jar, called hasp.jar.
3. I created a new web project called HaspWeb. I creates a jsp file in it: test.jsp.
4. In the web project's properties , in the "Java build path" window I added to the class path the hasp.jar - the jar that I created,
after copying it from the place that I creates it to the HaspWeb\WebContent\WEB-INF\lib folder. I added it to the class path from
5. In my jsp file this is my very simple code: (I remind you that CheckFlow() is a static method):
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 6 in the generated java file
Only a type can be imported. Hasp.HaspDemo resolves to a package
An error occurred at line: 13 in the jsp file: /test.jsp
Hasp.HaspDemo cannot be resolved to a type
10: <title>Insert title here</title>
13: <%= Hasp.HaspDemo.CheckFlow() %>
Well, *really* the first thing I'd look at is your package naming convention, but that, at least, won't cause an error.
Joined: Apr 21, 2008
after copying it from the place that I creates it to the HaspWeb\WebContent\WEB-INF\lib folder
Here 'HashWeb' is your application context. 'WEB-INF' must be directly inside 'HashWeb'.
Joined: Nov 12, 2009
Do you mean that you have a common class package, and you would like to import it into JSP file, or you've just needs to produce a java file only for the project, which means , you just needs to put your .class file into WEB-INF/classes.
So, it would be good to state your problem more clearly.