Tomcat related
<!--servlet Hello--
<servlet>
<servlet-name>Hello</servlet-name>
<servlet-class>com.foobar.Hello</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Hello</servlet-name>
<url-pattern>/Hello.view</url-pattern>
</servlet-mapping>
<context docbase= "/foo/bar" reloadable= "true"/>
Get requests are limited in length, content appears on the address bar, unsafe, post requests do not, but cannot be bookmarked. Post can avoid caching, but it can also be avoided if get plus timestamps.
Whether the request is idempotent: whether the server state is changed, and whether the same operation returns the same result.
URL encoding,%2f, "/", use Urldecoder and urlencoder to manipulate URL encoding. The data of the browser post is encode by the browser, such as "Forest" and "%e6%9e%97" (Utf-8 encoding), if the container uses ISO-8895-1 encoding, then the data obtained by the servlet will be "%e6%9e%97" Foobar "(Will be decoded with iso-8895-1), the data will be chaotic at this time. For post, you can use setcharsetencoding to solve (but only for body), and for Get, use new String (Foobar.getbytes ("iso-8895-1"), "Utf-8") to solve, The encoding problem should use filter. Consider: If you post a URL with a query string.
Java Note 3