Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Specifying a PORT number when accessing a Servlet problem?

 
Siphiwe Madi
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have created a Servlet that allows users to Download and/or save a File through the File/Save Dialog box.
The problem is that when I access the Servlet
(e.g. http://<ServerName>:9081/Download/filedownloaderservlet/)

i specify the PORT number,
and If I omit the port number:
http://<ServerName>/Download/filedownloaderservlet/

I get a Page NOT Found error.

My Questions are:
1. How can I allow the Servlet to be accessed without specifying the PORT number?
2. Are there any Security RISKS in specifying the PORT number?

Thanks in advance.

Regards,
Siphiwe Madi
[ October 16, 2008: Message edited by: Bear Bibeault ]
 
Rahul Noel
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to my knowledge,with out giving port no. we can't access resources(our application) in server.
There is no risk at all mentioning port no. of the server.
[ October 16, 2008: Message edited by: Reddy Naidu Chowdhary ]
 
Phani Raju
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based on the url given I see that you are using http protocol and default port for this protocol is 80. So if you can run your webserver on this port, you can access the required page without giving the port.
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Port number are like gates to enter into the system. So to connect to any computer you do have to provide the address of the computer called IP address with the gates number called PORT number.

Moreover there is no threat in exposing your port number as far it is for HTTP which can only listen to the Request coming and serving them as defined by the user.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The default port for HTTP is 80, so that's what it will use if you don't specify the port number (conversely, that's where the servlet needs to run if you don't want the URL to contain a port number).

There are no particular risks in specifying the port number, and -as stated above- not having one in the URL still specifies which port to use.
 
Siphiwe Madi
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks a lot for the responses. I think i'm clear as you have answered my questions and concerns.

Once again Thank you.
Regards,
Siphiwe Madi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic