Java-Web:Workshop-Introduction to Servlets

From Juneday education
Jump to: navigation, search

This chapter is just the placeholder for a workshop introducing Servlets. You can see the first part of the workshop in videos here:

Videos, source code and workshop slides

Se both videos here:

The next chapters take a deeper look at Servlets. Keep on reading!

Trouble shooting

  • Downloading winstone.jar using wget (on MacOS) - See: Bash_FAQ#Certicate_errors_with_wget
  • Verify the downloaded JAR file is correct: Use the command file with the JAR file as the argument. If file answers "empty" or "HTML", then we have a problem. Verify that the link used for downloading the JAR file really leads to the JAR file and not to a web page (HTML) with a link to the JAR file - correct reply from file should be simlar to winstone.jar: Zip archive data, at least v1.0 to extract
  • Compilation errors
    • Class not found javax.http... You need the JAR file in your classpath (javac -cp winstone.jar .....)
  • Errors during runtime
    • Check your servlet's package declaration and verify that the Servlet source code is located in a directory structure (under www/WEB-INF/classes/ that corresponds to the package name
    • Check that your servlet's source code file (before .java) corresponds with the name of the class


« PreviousBook TOCNext »