Solved

Setting up JSDK 2.1

Posted on 2001-06-04
5
394 Views
Last Modified: 2012-06-27
My question is very simple:

Is there anybody out there that can tell me in which directory of the JSDK I have put my servelets in ?

I am using JSDK2.1 and its web server to test servlets in my Sun Sparc with Solaris. However, I am not able to run the servlets from the web browser because the server does not know where they are...but they are right there.

This is obviously a configuration problem with JSDK. I don't know how to change the files "default.cfg", "mapping.properties", and "servlets.properties" in a way that makes the server work (i.e. find the servlets that I am evoking).

I need help on altering the configuration of those files to make my servlet server work. I've dissected all the information from java.sun.com but their examples are too general.

Are you up to the challenge ?
0
Comment
Question by:8088MMX
  • 3
5 Comments
 

Expert Comment

by:gmhegde
Comment Utility
Hi,
The servlets have to be put in the following dir
jsdk2.1/httproot/webapp/servlets/yourfile.class
you can see the output at
http://<machinename>:8080/servlet/yourfile
IMP dont use local host in place of machine name.

there is no need to change any of the configuration files.
THe servlet engine by default runs of port 8080 .Ensure that there is no other server which is running on that port before u start servlet engine.

The files are for fine tuning
default.cfg you can change the port number to some other value
servlet.properties  you can set init parameters for your servlets.

Hope u get the display now
Ganu
0
 

Expert Comment

by:gmhegde
Comment Utility
Hi,
The servlets have to be put in the following dir
jsdk2.1/httproot/webapp/servlets/yourfile.class
you can see the output at
http://machinename:8080/servlet/yourfile
IMP dont use local host in place of machine name.
eg
http://mmx:8080/servlet/yourfile
there is no need to change any of the configuration files.
THe servlet engine by default runs of port 8080 .Ensure that there is no other server which is running on that port before u start servlet engine.

The files are for fine tuning
default.cfg you can change the port number to some other value
servlet.properties  you can set init parameters for your servlets.

Hope u get the display now
Ganu
0
 

Expert Comment

by:gmhegde
Comment Utility
Sorry dont get confused
What i meant is dont use
http://localhost:8080/servlet/yourfile
but something like
http://mmx:8080/servlet/yourfile
where mmx is your machine name
0
 
LVL 3

Accepted Solution

by:
shyamkumarreddy earned 300 total points
Comment Utility
Hi MMX

I will give u the clue now.
U can find out urself now where to put the file okay.

The step to follow

1. Run your kit
2. Go the example
3. Run the example if it runs great
4. Just search for the ServletFile.class in your directory.
5. It is the area where u not to put ur servlet class file
:)
6. if u wanted to be in package. Then add a directory to it
and put the files under the directory

And access it package.ServletName

Cheers
Shyam
0
 
LVL 1

Author Comment

by:8088MMX
Comment Utility
Thank you for the time you took to answer my question. What Ganu suggested did not work. I put my servlets in the directory path that you mentioned but the server still would not find my files.

Then, I tried Shyam's solution and everything started working fine.

As it turned out, I could create a directory to put my own servlets in, but I had to register it in the default.cfg file. And not all the directory names work. The directory structure has to be  of the form <jsdk_root_dir>/mydirectoryname/WEB-INF/servlets

if I changed the WEB-INF name to any other name, the server could not get to the /servlets directory.
Then, I had to include two lines in default.cfg with the following form: server.webapp.mydirectoryname.mapping=/mydirectoryname
server.webapp.mydirectoryname.docbase=mydirectoryname

after doing that I could access my servlets from the browser with http://magik.blabla.edu:8080/mydirectoryname/servlet/MyServletFile

I appreciate the time that both of you took to answer my question. It was a easy question and not worth 300 points, but I needed a working answer fast, so the points go to Shyam.

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now