When you use Eclipse to create a servlet, Eclipse is created with a reference to a template, which makes it a lot easier, but there are a lot of annotations and default settings in this template. After we figure out what the servlet is and how it's used, it's always a bit annoying to create a servlet every time. For example:
A servlet created in this way is created from a template. This is not a bit messy.
Here's how to modify this template:
1.Myeclipse installation directory inside the search
Com.genuitec.eclipse.wizards_11.5.0.me201310291746.jar
Find the following:
2. Right-key compression format open
Find Templates folder
3. After you have seen the location of the template, copy one out to stay for backup may also need to restore the original template after the time (can also make the entire jar backup more violent simple)
Open the template and look like this
Generally we deal with Doget and dopost requests, so generally only modify these two can be, the other on-demand changes, I changed to this:
Save it after the change. The modified template is then overwritten into the original package (close MyEclipse first), and then the new servlet will be created as you modified it. Done.
As follows: