Servletconfig#getinitparameter () acting on a single servlet
Servletcontext#getinitparameter () Acting on the global servlet
Scopes are different, but all need to be configured in Web. XML to return only the string type variable
Httpservletrequest#getparameter (): Gets the name value of the element in the form in the page, the client returns data to the server, and only the string type variable is returned
Httpservletrequest#setattribute () and getattribute () implement data retention in HttpServletRequest, which is used in a httpservletrequest life cycle. In the same servlet doget (), the DoPost () method and the JSP page pass parameters, the JSP page is made to convert.
ServletContext implements data sharing in Servlets under the same project through SetAttribute () and getattribute (), and all Servlets share a single ServletContext instance, singleton mode under the same project.
Both of these return values are object.
Reference reading:
Http://stackoverflow.com/questions/18490517/jsp-getattribute-returning-null
Http://stackoverflow.com/questions/5243754/difference-between-getattribute-and-getparameter
http://blog.csdn.net/liqinghuan_blog/article/details/11486017
Servlet getinitparameter (), GetParameter (), getattribute () similarities and differences