Jump to content

Recommended Posts

Posted

Hi. I'm softlab on Johnny.

 

I have a problem with Java. I have a jsp page in my public_html folder (index.jsp) that links to other jsp pages within a subfolder; these jsp pages import a class within a package, and the package jar is in the WEB-INF/classes folder within public_html.

 

When I try to load the jsp page within the subfolder, i get this error:

 

 

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. it.swlab.util.FunzioniSessione resolves to a package

 

An error occurred at line: 7 in the jsp file: /index.jsp

FunzioniSessione cannot be resolved to a type

4: <%

5: synchronized(this)

6: {

7: FunzioniSessione funzioniSessione = new FunzioniSessione();

8: String percorso = config.getServletContext().getRealPath("/");

9: funzioniSessione.inizializza(session,request,response,percorso,"infocar");

10: boolean connesso = session.getAttribute("utenteConnesso") != null;

 

 

This is the import:

 

<%@page import="it.swlab.util.FunzioniSessione;"%>

 

and the line where is got the error is a simple instantiation of the class:

 

FunzioniSessione f = new FunzioniSessione();

 

 

 

 

What's the problem?

 

Thank you

 

Posted
Is this function .inizializza() public one?

 

 

 

Try this:

<%@page import="it.swlab.util.FunzioniSessione" %>

 

Thanks for answering.

 

Yes, the function is public; in my environment (I'm using NetBeans 7.0 with JDK 1.6) all is Ok and functioning.

 

The first version of the import was without ";" at the end, but the result was the same (but in my environment Ok as before).

 

Any other suggestions?

Posted
You are trying to say that "it is working in Desktop but not in Heliohost ",right?

 

That's right.

 

If I run my project in NetBeans with Tomcat 7, all is Ok and I can see every page I request.

 

When I upload the content of the "build/web" folder of NetBeans to heliohost, I can see only the first page, which does not import any java class; but if I try to request the first page that has a java import, the it fails as said in the first post.

 

Can you help me?

Posted

Hmm. Sorry brother, I have worked with Netbeans only but never uploaded to online server. Never uploaded the files to Online server.

 

But here i can point something:

Helihost has Tomcat 5 Server. I don't think that will be problem.

 

If you want more help, visit the Sun Java(now it is oracle Java) Forum. They will help you.

 

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...