Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Setting up JSDK 2.1

Posted on 2001-06-04
5
Medium Priority
?
432 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
[X]
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
  • 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 900 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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

688 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