|
-
October 6th, 1999, 01:03 AM
#1
Java Web Server
I'm having problems chaining servlets in JWS. But to solve that I must solve this: how to configure a simple servlet in JWS. I've been using JSDK to test servlets ie. servletrunner but I'm not having much luck with JWS. What is the proper way of configuring a simple servlet in JWS?
Here are the steps i've taken:
1. I copied the class file of my servlet in the 'servlets' subdirectory in JWS
2. I added the servlet in the 'Servlets' configure panel. I added the name 'FormBrat' and the classname 'FormBrat'(not FormBrat.class).
3. Under the Servlet Aliases in the 'Setup" configure panel, I added '/FormBrat' under 'Alias' and 'FormBrat' under 'Servlet Invoked'
Now..what is the properway to call it? I tried http://localhost:8080/servlet/FormBrat..and it did not find it. I even manually 'loaded' it in the configuration but it could not find it! (How can it not find it if I placed it in the servlet subdirectory??) Do I have to set CLASSPATH for this? The 'counter' servlet that came with the JWS works just fine and its class file is LOCATED in the servlets subdirectory. I even tried deleting the counter.class file from the subdirectory and manually loading it. It couldnt find it as expected but it said 'cannot load local code Counter'?
With my servlet it couldnt find it but it did not mention anything about local code. HELP...CONFUSED
Thanks
Dino
-
October 6th, 1999, 03:46 AM
#2
Re: Java Web Server
I believe I solved it...configuring the simple servlet that is.
Although the servlet class was were it should be ie.d:\jws\servlets, the author extended another class ie. CoreServlet that contained the init method instead of extending GenericServlet. I simply included the CoreServlet.class in a subdirectory called 'classes' ie. d:\jws\classes. I believe I could have included it in d:\jws\servlets but since it really wasnt a servlet I decided not too. In addition I also could have set CoreServlet.class' CLASSPATH. Either of these would probably have worked. By placing it in d:\jws\classes, I didn't have to set anything - Java Web Server automatically looks in this subdirectory. The simple servlet now works successfully.
...now Im gonna try Servlet Chaining which includes FormBrat.
Dino
-
October 6th, 1999, 03:44 PM
#3
Re: Java Web Server
ok im having other problems trying to configure this other class which uses a support class. I tried placing this support class in the class subdirectory but it isn't working. I havent tried setting CLASSPATH but i doubt it will work. Could anyone give me hints on this?
Thanks
Dino
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|