• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Compiling Error

 
P. Sagdeo
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have no clue what this means! I looked at several websites to make sure that this was correct, and I don't see anything wrong. Can anyone help?

If it matters, here's my code, down to the point:
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is returnHi really the name of a class? If so, it should be named ReturnHi to conform to accepted Java standards. It must also be in a package other than the default for the container to be able to find it correctly.
 
P. Sagdeo
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so you mean that returnHi (I learned my JAVA from a high school course as a freshman(that I haven't completed) so pardon the misconformities) must be in a package? Does that mean I can't have it lying just in the same folder? Thanks for the reply though
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct, the various servlet containers have problems loading classes that aren't in non-default packages. What container are you using?
Your class hierarchy must also be placed in the web app's WEB-INF/classes folder or jarred up and placed in WEB-INF/lib.
 
P. Sagdeo
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm pretty sure that I'm using Tomcat 5.0, if by container you mean server. If I'm not being clear could you kindly explain to me what a container is? By the way, I've been doing servlets succesfully for a while and now I'm trying JSP. I'm also going to look up how to make packages. Thanks!
 
P. Sagdeo
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sigh, I put it in a package, but alas, it doesn't work. Here's the code of the JSP
and here's the code for returnHi, which is in a folder called hi
 
P. Sagdeo
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
turns out all I was missing was that it wasn't in the web-inf folder! well, at least I read somewhere that "Good Judgement comes from Experience, Experience comes from bad Judgement". Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic