Form label forms Echo and submit

Source: Internet
Author: User

SPRINGMVC does not have a struts2-like tag library, but the form tag is also useful

1.javabean fragments

public class User implements serializable{    private static final long serialversionuid = -1684752473484153239l;    Private String ID;    Private String Dept;    Private String account;    private String name;    private String password;    Private String headimg;    private Boolean gender;    Private String State;    Private String Mobile;    private String Email;    Private Date birthday;    Private String Memo;    User status: 0-Invalid, 1-valid public    static String user_state_valid = "1";    public static String User_state_invalid = "0";}

2. Echo method

Jump to edit page    @RequestMapping (value= "/editui") public    String Editui (String ID, model model) {        Boolean Headimgexist = false;        if (id! = NULL) {            User user = Userservice.findobjectbyid (ID);            echo Data            model.addattribute ("user", user);            if (user.getheadimg (). Length () > +) {                headimgexist = true;                echo Avatar                model.addattribute ("headimg",   Request.getcontextpath ()//                          + "/" +dirs+ "/" +user.getheadimg () );            }            Model.addattribute ("Headimgexist", headimgexist);        }        return "Editui";    }

3. Echo Page

<%@ page contenttype= "Text/html;charset=utf-8" language= "java"%><% @taglib prefix= "C" uri= "/http Java.sun.com/jsp/jstl/core "%><%@ taglib uri=" Http://www.springframework.org/tags/form "prefix=" SF "%>< html>

Form label forms Echo and submit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.