Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320637 - HTTP Server Overview HTTP port: input does not allow ports over 100
Summary: HTTP Server Overview HTTP port: input does not allow ports over 100
Status: RESOLVED FIXED
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P2 normal (vote)
Target Milestone: 3.4.1   Edit
Assignee: Steven Hung CLA
QA Contact: Angel Vera CLA
URL:
Whiteboard: pmc_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-22 10:28 EDT by M.H. CLA
Modified: 2017-10-11 16:38 EDT (History)
4 users (show)

See Also:
eyuen7: pmc_approved? (david_williams)
eyuen7: pmc_approved? (raghunathan.srinivasan)
eyuen7: pmc_approved? (naci.dai)
eyuen7: pmc_approved? (neil.hauge)
kaloyan: pmc_approved+
eyuen7: pmc_approved? (cbridgha)
eyuen7: review+


Attachments
Patch v1.0 (2.28 KB, patch)
2012-06-13 14:48 EDT, Steven Hung CLA
eyuen7: iplog+
eyuen7: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description M.H. CLA 2010-07-22 10:28:33 EDT
Build Identifier: 20100617-1415

When I setup a HTTP Server for my Static Web Project it allows me to put any port number I want ie: 8888. When I go to the "Servers" view and double click on the Server I just created the number in HTTP Port shows as 100 and will not allow me to enter anything higher. As long as I don't save using the Overview page it is ok and 8888 is used as the port. Otherwise it would save as 100.

Reproducible: Always

Steps to Reproduce:
1.Select Servers View
2.Double click on Server
3.Enter number above 100 in "HTTP Port:" number entry.
Comment 1 Ryan Smith CLA 2010-09-22 09:26:34 EDT
I have also am seeing this issue on Windows XP.

Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 1 (EPP pre-release)
Build id: 20100913-1231
Comment 2 Steven Hung CLA 2012-06-13 14:48:05 EDT
Created attachment 217311 [details]
Patch v1.0

The port widget uses the org.eclipse.swt.widgets.Spinner. The setMaximum value was not set correctly and that had the side-effect of having the maximum port number of 100.

Overview of fix:
The setMaximum value was set to 999999 (which was the original intention) and I also put a maximum character limit equal to number of characters of the maximum port number. The maximum characters is to handle the case where the user manually enters in the port number instead of incrementing via the widget.

Tests run:
Setup: I used apache http 2.2 as my server
1. I had apache using port 7900 and ensured I could change the port in the server editor to 7900 (from 80) and it would save correctly. When I ran the static web page, I verified that the content was correct
2. I verified that I could open the server editor when I had put in a higher port number than 100 and the value would be in the server editor (previously it would set it to 100 as the maximum)
3. I verified that the port number range can go between 0 and 999999 using both manual input and by using the widget's increment and decrement. I ensured saving and re-opening the editor would result in that port number being saved
Comment 3 Elson Yuen CLA 2012-08-21 15:24:40 EDT
Comment on attachment 217311 [details]
Patch v1.0

Thanks for submitting the patch. The changes looks good and the test coverage is good.
Comment 4 Elson Yuen CLA 2012-08-21 15:25:16 EDT
Changes released to 3.5.
Comment 5 Steven Hung CLA 2012-08-21 17:16:59 EDT
WTP 3.4.1 PMC candidate information:
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such.
This issue is not a stop-ship defect, but it is a usablity issue, since the user cannot change their port number for their HTTP server to a port higher than 100 once it has been created.

* Is there a work-around? If so, why do you believe the work-around is insufficient?
The workaround is to delete the server and create a new HTTP server again, which is annoying for the user, since they should be able to change it for an existing server.

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added?
The following tests were run:
Setup: I used apache http 2.2 as my server
1. I had apache using port 7900 and ensured I could change the port in the server editor to 7900 (from 80) and it would save correctly. When I ran the static web page, I verified that the content was correct
2. I verified that I could open the server editor when I had put in a higher port number than 100 and the value would be in the server editor (previously it would set it to 100 as the maximum)
3. I verified that the port number range can go between 0 and 999999 using both manual input and by using the widget's increment and decrement. I ensured saving and re-opening the editor would result in that port number being saved

No new JUnit tests were added.

* Give a brief technical overview. Who has reviewed this fix?
The setMaximum value was set to 999999 (which was the original intention) and I also put a maximum character limit equal to number of characters of the maximum port number. The maximum characters is to handle the case where the user manually enters in the port number instead of incrementing via the widget.

The fix was reviewed by Elson Yuen

* What is the risk associated with this fix?
Low, since it only affects the changing of the port number for a HTTP server, once it has been created.
Comment 6 Elson Yuen CLA 2012-08-21 17:23:34 EDT
Given that port higher than 100 is a fairly common scenario. I am marking this one for PMC approval.
Comment 7 Kaloyan Raev CLA 2012-08-22 04:01:40 EDT
Approved.
Comment 8 Elson Yuen CLA 2012-08-23 10:33:29 EDT
Code released to 3.4.1.
Comment 9 Eclipse Genie CLA 2017-10-11 16:38:43 EDT
New Gerrit change created: https://git.eclipse.org/r/109125
Comment 10 Eclipse Genie CLA 2017-10-11 16:38:50 EDT
New Gerrit change created: https://git.eclipse.org/r/109124