Jump to content

Java problem


softlab

Recommended Posts

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

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...