The first way: form submission, add onsubmit event in form label to determine whether form submission is successful?
12345678910111213141516171819
"http://www.jb51.net" onsubmit="return validate(document.getElementByIdx_x(‘myText‘
Rest style/USER/1 GET request Get user/USER/1 POST request New user/USER/1 Put request update user/USER/1 Delete request Deletes a userHow do I submit a put and delete request in spring MVC?You need to configure a hiddenhttpmethodfilter filter in
Need to add filter filters: HiddenhttpmethodfilterYou can turn the POST request into the rest style of delete and put, and of course the post; Filter> Filter-name>HiddenhttpmethodfilterFilter-name>
In projects, we often encounter the need to pass Chinese characters in JSP page transitions. There are two main ways of doing this.
Url method
For example:
Http://website/test1.jsp?act=add&type= Apple ¶m=%20d%20b
Form mode
For example:
Four, send data to the serverNow we don't have much difficulty reading data from the database. But how do you send data to the database in turn? In fact, this is not a problem with PHP. First, we create a Web page with a simple table.
Sometimes this happens when you need multiple buttons on a form to accomplish different functions, such as a simple approval function. If you're using webform that doesn't need to be discussed, but a form in ASP. NET MVC can only be submitted to an
Transferred from: http://blog.csdn.net/sknice/article/details/42323791in ASP. NET MVC, the data is often passed between the controller and the view, so it is important to master the data transfer method between the two layers skillfully and flexibly.
1. pathvariable annotationsPlaceholder for mapping URLs to the parameters of the target methodExample:@RequestMapping ("/testpathvariable/{id}") public String testpathvariable (@PathVariable ("id" Integer ID) {SYSO (id);}Request:/TESTPATHVARIABLE/10
(i) MVC html.antiforgerytoken () to prevent CSRF attacksHtml.antiforgerytoken () in MVC is a measure to prevent cross-site request forgery (Csrf:cross-site requests forgery) attacks, which are called XSS (XSS, also known as Css:cross-site-script ),
Perl-compatible regular expressions
First, Function:
Preg_match (): Indicates whether the pattern matches the string and returns 1 if a match is found, otherwise 0
Preg_match_all (): Found all matches
Preg_replace (): Implementing
4. it is no longer difficult to read data from the database to send data to the server. But how can we send data to the database in turn? In fact, this is not a problem with PHP. First, create a webpage with a simple table. $ #@ 60;
Several methods of action obtaining form data in Struts2 several ways to get form data from action Struts2Struts2 action Get table only son value1. By attribute-drivenJsp:formAction= "Sys/login.action"Method= "POST"> inputtype= "text"name=
How data is aligned in a cell
Align = leftAlign = centerAlign = rightValign = topValign = middleValign = bottom
Merge cells
Horizontal merging in the OR tag using the COLSPAN property, you can set the number of columns that the
Html.antiforgerytoken () in MVC is a measure to prevent cross-site request forgery (Csrf:cross-site requests forgery) attacks, which are called XSS (XSS, also known as Css:cross-site-script ), the attack is different, XSS is generally the use of
Test entity classes Public classTest { Public intid{Get;Set;} [Required (ErrorMessage="can't be empty!")] [Stringlength (Ten, errormessage="The string cannot exceed ten")] Public stringtitlenew{Get;Set;} }Code generated with @using ("form"
(i) MVC html.antiforgerytoken () to prevent CSRF attacksHtml.antiforgerytoken () in MVC is a measure to prevent cross-site request forgery (Csrf:cross-site requests forgery) attacks, which are called XSS (XSS, also known as Css:cross-site-script ),
The most important change is that the form element can not be written in the form tag. Written elsewhere, add a form attribute to commit theThere's nothing else to feel, form validation can not prompt information, feel not practicalDOCTYPE HTML>HTML>
1.1 Action and Method propertiesA form is a container that contains input elements, including buttons, check boxes, text boxes, and so on. These input elements in the form allow the user to enter information into the page and submit the input
One, @RequestMapping mapping requestsSpring MVC uses @requestmapping annotations to define different processor mapping rules.
@RequestMapping placed on top of the class name, set the request prefix
Set Request Map URL above method name
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.