This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 87738 - Servlet template treats GET and POST as the same method
Summary: Servlet template treats GET and POST as the same method
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-23 01:22 UTC by fuzzybsc
Modified: 2016-07-07 08:53 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fuzzybsc 2006-10-23 01:22:54 UTC
The default template for a new servlet treats GET and POST as the same method.
This is contrary to good and RESTful web practice.

Steps to reproduce:
* Create new servlet

Expected results
* doGet and doPost are separate methods

Actual results
* doGet and doPost both call "processRequest", and their implementations are
folded away from the user
Comment 1 Andrei Badea 2007-10-18 15:13:11 UTC
Not a defect. The default servlet template is just intended to provide a simple servlet that always does something
meaningful. If you want GET and POST to do different things, you can always edit the respective method.

We could provide a new template (or enhance the default one) to allow you to choose whether GET and POST do the same,
but I don't think that would have a high priority.
Comment 2 fuzzybsc 2007-10-26 03:27:32 UTC
Ok, but to clarify: GET and POST doing the same thing is a bug. This template is equivalent to one that produces a java
bean using a common implementation for get_foo() and set_foo().
Comment 3 Martin Balin 2016-07-07 08:53:03 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss