SpringMVC web framework

The bottom layer is the Servlet

  1. How to set up a framework

1. guide jar package
2. Write Configuration File
3. Start writing your own business

 

 

  2. How to preach the value of the front and back and we used to make a comparison of the Servlet

Pass value (value transmitted from the controller to the foreground the JSP) 
  1. transmitted single value     ${welcome}
  2. passing a List collection
    <ul>
        <c:forEach items="${uList}" var="u">
            <li>${u}</li>
        </c:forEach>
    </ul>

Tap values (values pass from the front to the controller)

1. A User object, which are three attributes (uid, uname, upwd)
<form Action = "/ get_Data" Method = "POST"> 
<INPUT type = "text" name = "UID">
<INPUT type = "text" name = "the uname">
<INPUT type = "text" name = " upwd ">
  <INPUT type =" Submit "value =" submit ">
</ form>


2. a User object, wherein four attributes are (uid, uname, upwd, desc ), wherein the object to Desc desc (DID, DText) in which the following two properties desc tap values
<form action="/get_data" method="post">
<input type="text" name="uid">
<input type="text" name="uname">
<input type="text" name="upwd">
<input type="text" name="desc.did">
<input type="text" name="desc.dtext">
<input type="submit" value="提交">
</form>

3. A User object, wherein the five attributes (uid, uname, upwd, desc, roles) wherein roles of a List <Role> List objects in this list format tap values
<form action="/get_data" method="post">
<c:forEach var="s" begin="0" end="3">
<tr>
<th>
<input type="text" name="roles[${s}].rid">
<input type="text" name="roles[${s}].rname">
<input type="text" name="roles[${s}].rdesc">
</th>
</tr>
</c:forEach>
<input type="submit" value="提交">
</form>

4. A User object, wherein the six attributes (uid, uname, upwd, desc, roles, parme) wherein Parme a Map / Set Object Map The tap values ​​format
<form action="/get_data" method="post">
<input type="text" name="parme['key']">
<input type="submit" name="提交">
</form>

 

  3. Redirects and Forwards

I do not want to view the results of the parser
    forward: index.jsp forwarding, you can carry data
    redirect: index.jsp redirects can not carry data

 

  4.Ajax knowledge

  The separated front and rear ends

  6. Develop Interface

Guess you like

Origin www.cnblogs.com/Tsugar/p/12469367.html