Weekly fifth week of summer vacation

1, request: a request scope is just simply means that the change request url, then the request would be ineffective
      setAttribute () getAttribute () removeAttribute ( )
      forwards the request: request.getRequestDispatcher (url) .forward (request , response );
         getContextPath (); --- name of the web application
      getRemotePath (); --- to gain access to the client IP address security chain startWiths (front); determining whether to front variables that begin
      getHeader (); --- acquisition request header acquired by requesting the corresponding variable name value value
      getHeaderNames (); --- variable name acquisition request to request header
         the getParameter (); --- acquisition request to obtain the corresponding value thereof by the value of the variable name request body
      getParameterMap (); --- all data requests are encapsulated into a body Map object.
 Note: request.setCharacterEncoding ( "UTF-8" ); can only solve the garbage problem post submission appears;
        you want to solve the garbage problem get presented in a way that appears to require the processing of each variable acquired
  parameter = new String (parameter .getbytes ( "ios8859-1"), " utf-8");
UUID.randomUUID (); generates 32-bit random string, Java randomly generated string 36
2, cookie: setMaxAge () s units will be set to 0 by default cookie that is valid for the destruction of a session browser to open the browser is closed.
     setPath (); Set the cookie carrying the scope of access setPath ( "/") represents the tomcat release access to the entire project carries the cookie created
     response.addCookie ();
     Note: cookie not allowed in the Chinese
     session: request.getSession () ; obtaining a client corresponds to a Session Session (corresponding to a JESSIONID a Session)
     default validity period is valid for thirty minutes (the configuration on web.xml) we also need to configure JESSIONID here to ensure that this Session of validity (one for a JESSIONID session)
     destruction: Close server, session failure / expired, manually the session.invalidate ();
                the session scope: a default session
3, jsp (essentially Servlet): Java script: <% Java Code%> <% = Java variable or expression%> <% Java Code%!> (Defined Servlet members)      
             Comment: html comment <- -! > View Source jsp, servlet translated, jsp compile
        Java annotations // / * servlet after the multi-line comment * / translation, jsp compiled
        jsp comments <% - -%> jsp compile
 static include <% @ include file = "contained in the file address"%> file into one
    dynamic include <jsp: include page = "included in the page" />
 forwards the request <jsp: forward page = "resources to be forwarded" /> connecting two files
 jsp nine objects built: OUT (of javax.servlet.jsp.JspWriter) Request (the javax.servlet.http.HttpServletRequest)
                 Response (javax.servlet.http.HttpServletResponse) config (javax.servlet.ServletConfig)
   the session (the javax.servlet .http.HttpSession) application (javax.servlet.ServletContext)
   page container page (java.lang.Object) pageContext (javax.servlet.jsp.PageContext) jsp of
   Exception (java.lang.Throwable)
(1) out 8kb default buffer can be set to 0 for close out the buffer contents directly write respons to the buffer
(2) findAttribute (String name) --- order from pageContext domain, request domain, session domain, application domain, obtain property, after acquiring a domain is not looking backward
summary of the four scopes :
page domain: The current jsp page range
request fields: first request
session domains: a session
application domains: the entire web application
. 4, the JSTL EL &
   the EL expression
 fetches data from the data field $ {name storage field}
 $} {pageContext.request.contextPath
   the JSTL tag (core libraries)
 <% @ taglib URI = "" prefix = "C"%>
 <C: IF Test = "">
 <C: forEach items = "array or collection" var = "array or collection element of each">
   javaEE three-tier architecture the MVC +
 Web layer: page data collection, data encapsulation, transmission data, specify a response jsp page
 service layer: writing business logic code
 dao layer: write database access code
5, transactional
MySQL transaction control:
 turn on the transaction: start transaction
 submitted to: commit
 rollback: rOLLBACK
JDBC transaction control
 to open the transaction: conn. setAutoCommit (false);
 rollback: conn.rollback ();
 submit: conn.commit ();
DbUtils transaction control 
using ThreadLocal: to achieve is to pass parameters by means of thread-bound
Isolation levels:
 Read Uncommitted
 Read committed
 Repeatable Read (the MySQL default)
 serialazable (deadlock)
. 6, dTree plug
D = new new dTree ( 'D');
d.add ('01 ', -. 1,' the menu tree system '); @ 01 represent the number of level -1 for the root node
d.add ( '0102', '01 ', ' category management', '', '', 'mainFrame'); // 0102 on behalf of that node, No. 01 is the parent node
d.add ( '010201', '0102 ', ' category management', '$ {pageContext.request.contextPath} /admin/category/list.jsp ', '', 'mainFrame'); // mainFrame indicating a position
document.write (d);
      that the failure <a> </a>: href attribute set bit javaScript: void (0);
      drop-down box to modify dynamically match: jQuery treatment
 $ function () {
        $ ( "#cid option [value = ' $ {product.cid}']"). prop ( "selected",true);
 }

Guess you like

Origin www.cnblogs.com/goubb/p/11300004.html
Recommended