java zero to one: Servlet and JSP-11: JSP tags and expressions el

1, jsp el expressions and label
        (1) jsp label what is?
               Because writing java code directly in the jsp file inside, convenient maintenance of the code
        (for example, art is not convenient to directly modify jsp), therefore, sum developed a jsp tag technical specifications,
       namely the use of jsp tag similar to html tags instead of java code, so, jsp files which
      you no longer have java code, jsp become more concise, and more conducive to maintenance.
        What (2) el expression is?
                  It is a simple calculation rule for assignment to a property jsp tag also
        can be used directly (which can also be out of jsp tag alone).
         
        Usage (3) el expressions
                1) access bean properties
                    Method 1:
                         $ {} user.name: order from pageContext, request,
                  find the session, application in (getAttribute) bound name is
                  "user" of the object, and then call the method getName and outputs a corresponding value.
                         
                      Note:
                            A, in turn means that first look pageContext, if
                  Can not be found, then find request, and so on, if found, it is no longer
                  look down.
                           b, if not, the output will be "";
                           c, attribute names can not be wrong, otherwise it will go wrong.
                        

Guess you like

Origin blog.csdn.net/kerryqpw/article/details/104084980