JSP Tutorial: action,form/common field of correspondence

Source: Internet
Author: User

Is the day to change the bug, today encountered this very headache, especially in other people's code based on the change, is the head big. After 2 hours, there is a mistake feeling very baffling, so that colleagues next to see a while, only to find out that they have made a naïve mistake, too do not pay attention to details:

The correct wording for a form is as follows:

The following are the referenced contents:
<% expenseitemform form = (expenseitemform) request.getattribute ("Oldexpenseitemform");
%>
<input name= "Expenseitemnumber" type= "text" class= "input"
Value= "<%=form.getexpenseitemnumber ()%>" size= ">


Action--------------------
Expenseitemform oldexpenseitemform = new Expenseitemform ();
Oldexpenseitemform.setexpenseitemnumber (Oldexpenseitemnumber);
.
.
.
Request.setattribute ("Oldexpenseitemform", oldexpenseitemform);

The correct wording for a common field is as follows:

The
The following is the referenced content:
<input name= "Roleid" "class=" "id=" Roleid "size=" &NBSP;
  value= "<%=request.getattribute (" Roleid ")%>" type= " Hidden "> 
or <input name=" Roleid "class=" "id=" Roleid "size=" "&NBSP;
  value=" ${roleid} "type= "Hidden" > 
Action-------------------- 
Request.setattribute ("Roleid", Roleid);
Related Article

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.