Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compiling servlet?

 
Kazi Siddiqui
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the first time I've tried to compile a servlet. I issued the following command from the project root directory: javac -classpath "e:\progra~1\apache~1\Apache Tomcat 6.0.18\lib\servlet-api.jar:classes:." -d classes .\src\com\paexample\web\WebControl.java

I got the following compilation errors:


I don't understand it. The path is holding the Java bin folder, and JAVA_HOME is set to C:\Program Files\Java\jdk1.6.0_13. Please help me compile this.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65227
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Under Windows, classpath elements must be separated by the semi-colon character.
 
Ryan Beckett
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change

"e:\progra~1\apache~1\Apache Tomcat 6.0.18\lib\servlet-api.jar:classes:."

to

"e:\progra~1\apache~1\Apache Tomcat 6.0.18\lib\servlet-api.jar"

and that will take care of the errors at line 4 and 5.

________________________



should be



and the same for HttpServletRequest and HttpServletResponse as well



 
Kazi Siddiqui
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course. It's right here in the book. Thanks, Ryan and Bear.

I'm trying to follow Head First Servlets & JSP's Mini MVC tutorial. However, I'm having lots of difficulty implementing it, though I suspect it's because of my own stupidity. For example, when I deployed the servlet, Tomcat refused to detect it, insisting that AcceptData.do doesn't exist even though it's defined in web.xml. Upon restarting Tomcat, it now refuses to acknowledge the existence of the web application at all, even the html pages. When I tried to recompile the servlet with a Model class, javac says it cannot find the model package:

Putting the compiled model class into the classpath doesn't seem to work.

I not even sure where to start sorting out this mess.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic