Ignoring "if it ain't broke" (or at least "if it ain't nitpicked yet"), I wanted add it to the same package used for the second version of BeeServlet and I wanted to use what may be a more elegant version using one of the classes in jr.jar.
I renamed the file and class to Reverse2 so that I wouldn't screw up the working version. [I will rename it back before confusing myself on Servlet-3.] I also created reverse2.html with " action='/servlet/Reverse2' "
jr.jar is in C:\Java and I'm successfully using two classes from it in DaysOld.
Using package com.javaranch.drive, I put Reverse2.class in:
I edited C:\Orion\default-web-app\WEB-INF\web.xml accordingly. This had worked fine for the second version of BeeServlet (the packaged version).
When I hit "submit" from reverse2.html I got:
I tried copying Str.class into the directory with Reverse2.class. Same result.
I tried copying jr.jar into C:\Orion\default-web-app\WEB-INF\classes (meaning just above the \com folder). Same result.
I commented out the package statement, compiled, and placed the new class file in
(removing the prior version from "drive" and removing Reverse2 from web.xml). Once again:
This occurred with both locations of jr.jar. I am at a loss again.
[Edit] Yes, I do have "import com.javaranch.common.*;"
[Edit2] OK, this is mildly embarassing. I'm fairly stubborn about finishing one problem before reading about the next, but I just decided to read on to the next assignment, and at the end of the MVC2 material I found:
"We need to make sure that when orion runs this program it can find the JavaRanch stuff. Copy jr.jar to c:\orion\lib\jr.jar (.jar is the name usually used for a collection of Java stuff. Sometimes we use .zip on JavaRanch because some browsers will garble a .jar file when downloaded - orion expects .jar)."