wood burning stoves 2.0*
The moose likes Servlets and the fly likes beginner deployment question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "beginner deployment question" Watch "beginner deployment question" New topic

beginner deployment question

tom boshell

Joined: Jun 26, 2001
Posts: 7
I am using Tomcat 3.2.3 and servlet api 2.2 (probably doesn't matter with this question though). I developed a servlet and tested it out on my machine with the localhost:8080 reference. Then I wanted to view it on another machine. But started to get errors. Then I thought about it and couldn't help but wonder if my only having a dynamic IP address would effect the servlet. ie the 'other' computer may not find the needed method every time. It will show the main page, but further pages that use redirection and/or url rewriting don't work. This is a problem since I am using a lot of forms and that is what is being killed. When I switch back to localhost and my computer everything is good again. I'm probably missing something simple in all this.
Any ideas? I am supposed to fully test it running on my machine before it is deployed to a 'real' server. (I say 'real' server since they only let me have a W95 machine with 64mb But I will get it)
Thank you,
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

if my only having a dynamic IP address would effect the servlet.

Nope, having a Dyn IP address is NOT the problem.
ie the 'other' computer may not find the needed method every time. It will show the main page, but further pages that use redirection and/or url rewriting don't work
Couple of this that strike me....
1. After the main page shows up, and you do something else
watch your Tomcat window for exceptions etc. These may give
you more data to debug your appln.
2. I am not sure of this, but I will say it anyways, (sorry)...
When you are re-writting the URL are you hardcoding to
localhost server instead of getting it from the
request....just asking.
Let us know a little more on this and hopefully someone
could help.
- satya

Take a Minute, Donate an Hour, Change a Life
Mary Taylor
Ranch Hand

Joined: Sep 11, 2000
Posts: 319
It sounds like you have accomplished more than I have thus far!
Can you look at my post "Tomcat installation on Windows2000 Server" and offer some assistance?
Oracle's web server 4.x did not work with DHCP. I guess TomCat has figured out a way around that?
tom boshell

Joined: Jun 26, 2001
Posts: 7
I am curious about your suggestion on item #2. I have used both the localhost during testing, and then the IP address when working with other computers. Your comment leads me to believe that you are inferring to another way to redirect with the req. Could you explain that?
chanoch wiggers
Ranch Hand

Joined: May 24, 2001
Posts: 245
usually you would encode links as relative rather than absolute. So all your URLs should look like href="index.jsp?blah=glah"
the browser will then look for index.jsp in the same directory as the page that it is currently showing. You can even use filepath like strings to move around your site relative to the page that is currently in the browser window. An example is:
say you are showing a form that is in a folder called forms:
the URL for your form is http://myserver/forms/myform.jsp
and you want a "back" link that goes to the home page. You can either have the link
which will direct the browser to the root of site or http://myserver. You can use
which will direct the browser to a file called somepage.jsp in the folder above the current one. etc, etc
if you use links that are like this:
then you are tying your application to an exact structure. If you want to move anything you get stuck in massive maintenance.

chanoch<p><a href="http://www.amazon.com/exec/obidos/ASIN/1861007736/" target="_blank" rel="nofollow">Author of Professional Apache Tomcat</a></p>
tom boshell

Joined: Jun 26, 2001
Posts: 7
Ok, so it is like the relative paths when accessing the hard drive. I am familiar with that since I have done some application programming in Java.
Thanks for the help.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15960

DHCP and webservers don't generally go well together. Prior to Windows 2000, the LAN name of the server was NOT resolvable via TCP/IP the way Unix hostname would be - Windows Networking didn't depend on DNS - its primary name resolution was Microsoft-proprietary.
This changed some in Win2K, but I don't know how much. At ALLTEL we didn't buy into Windows 2000 because we were a large IBM mainframe shop with lots of token-ring NICs and Windows 2000 didn't have drivers for them, so I'm speaking from what I've heard rather than what I've seen.
At any rate, the easiest (technically, if not politically) solution is to lock down the IP address of your server and set it up in DNS.

Customer surveys are for companies who didn't pay proper attention to begin with.
It is sorta covered in the JavaRanch Style Guide.
subject: beginner deployment question
Similar Threads
NX: RMI check available port or host number
RMI * java.net.ConnectException * occurs when client on remote computer
Servlet as an rmi client
unable to view images across the network
RMI hostname problem, Please Help