Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile error 2

Status
Not open for further replies.

MarkShark

Programmer
Aug 22, 2001
36
US
I tried, but failed at fixing this one. Thanks in advance to anyone trying.

LessonServlet.java:34: Public class CourseServlet must be defined in a file call
ed "CourseServlet.java".
public class CourseServlet extends HttpServlet

 
It would be nice if you would post your code for easyer debugging, but I think that it's telling you to rename your program "CourseServlet.java" because of the statement at the top "public class CourseServlet {", that should be the first line of code after any imports you might make. Either change the code to" public class LessonServlet {" or change the name of the file to "CourseServlet.java".
 
Your class needs to be the same name as the file. In your case you need to do one of two things:
1) Change the filename to CourseServlet.java
2) Change the classname to LessonServlet Wushutwist
 
See what happens when you sit too long on the reply page? You get beaten to the punchline. Wushutwist
 
??????

The filename is CourseServlet.java
The classname is LessonServlet
 
Well then either change the file name to match the class name, or change the class name to match the file name!
 
Just a typo there, they are both matched in the script...LOL

New error when I -deprecated the compile

LessonServlet.java:87: Note: The method java.lang.Object getValue(java.lang.String) in interface javax.servlet.http.HttpSession has been deprecated.
Integer studentID = (Integer) session.getValue ("studentID");
^
LessonServlet.java:96: Note: The method void putValue(java.lang.String, java.lan
g.Object) in interface javax.servlet.http.HttpSession has been deprecated.session.putValue ("courseID", new Integer (courseID));
^
Note: LessonServlet.java uses or overrides a deprecated API. Please consult the
documentation for a better alternative.
1 warning
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top