Setting up JSDK 2.1

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 ?
LVL 1
8088MMXAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
shyamkumarreddyConnect With a Mentor Commented:
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
 
gmhegdeCommented:
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
 
gmhegdeCommented:
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
 
gmhegdeCommented:
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
 
8088MMXAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.