Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Setting up JSDK 2.1

Posted on 2001-06-04
5
409 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
ID: 6155060
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
ID: 6155062
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
ID: 6155063
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
ID: 6155095
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
ID: 6157039
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Which non-HTML GUI front end to use with Java? 3 24
jboss 7.1 start up error 1 37
collection output issue 9 36
running on tomcat not jboss eap 7.0 3 18
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

860 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