Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » jsp + jar - whole case details.
jsp + jar - whole case details. [message #499525] Mon, 23 November 2009 08:40 Go to next message
moshi  is currently offline moshi
Messages: 28
Registered: November 2009
Junior Member
Hi,
so here is the all data (I'm using Eclipse) :

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
this location.

5. In my jsp file this is my very simple code: (I remind you that CheckFlow() is a static method):

<%@page import="Hasp.HaspDemo"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%= Hasp.HaspDemo.CheckFlow() %>
</body>
</html>

6. I'm getting the exception of:

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>
11: </head>
12: <body>
13: <%= Hasp.HaspDemo.CheckFlow() %>
14: </body>
15: </html>

7. Thanks for any help.
Re: jsp + jar - whole case details. [message #499980 is a reply to message #499525] Tue, 24 November 2009 16:04 Go to previous message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2314
Registered: July 2009
Senior Member
Are the DLLs somewhere that Tomcat can find them? Are you sure that
the contents of the jar file are laid out properly? Does the JSP
Editor show any error messages?

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:Problem with annotations in a dynamic web project
Next Topic:JS Code completion does not work
Goto Forum:
  


Current Time: Fri Oct 31 15:13:58 GMT 2014

Powered by FUDForum. Page generated in 0.01483 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software