Notes for Web Development

Source: Internet
Author: User

1. character encoding conversion:
String XM = new string (txm. getbytes ("ISO8859-1"), "gbb2312 ");
2. the prompt box is displayed:
<Script language = "JavaScript">
Alert ("instructor information added ");
</SCRIPT>
3. The hidden box must be placed in TR and TD to be submitted as a form. When you use the. Do method to pass Parameters to another page, you must use the hidden box to pass the default parameters.
4. SQL statement for fuzzy search by name:
"Select uid, XM, zgh, UUID from hust_jg_jb where XM like '" + xmtemp + "%' and XM! = '"+ XM +" 'order by XM"
Xmtemp is the name of the obtained name.
5. Statistical SQL statement:
String SQL = "select distinct hust_jg_ds.yjxkm as DM, dm_jb_yjsyjxk.mc as MC," +
"(Select count (*) from hust_jg_ds where dslbm = '3' and hust_jg_ds.yjxkm = dm_jb_yjsyjxk.dm) as BSD," +
"(Select count (*) from hust_jg_ds where dslbm = '1' and hust_jg_ds.yjxkm = dm_jb_yjsyjxk.dm) as BD," +
"(Select count (*) from hust_jg_ds where dslbm = '2' and hust_jg_ds.yjxkm = dm_jb_yjsyjxk.dm) as SD," +
"(Select count (*) from hust_jg_ds where dslbm! = '1' and dslbm! = '2' and dslbm! = '3' "+
"And hust_jg_ds.yjxkm = dm_jb_yjsyjxk.dm) as other" +
"From hust_jg_ds, dm_jb_yjsyjxk where hust_jg_ds.yjxkm = dm_jb_yjsyjxk.dm ";
Note the use of subquery statements.
6. When Using JSP in the development process, you should pay attention to step-by-step operations. After completing one function, you can perform another function. parallel operations are not feasible.

7. When using the Struts-like structure for development, pay attention to clear the transaction flow, and do not set errors for the files in each step. It mainly involves the following aspects:
Actionform (includes two default methods: Validate and reset );
Action;
Struts-config; prevents the error that the form is not filled with data.

8. Pay attention to setting the return value for each action to provide the basis for exception handling.

9. To determine whether an arraylist contains an element, use arraylist = NULL instead of arraylisy. inempty.

10. Database exception data tuncation: the length of the field required by the database is different from the length of the given field. The length of the given field exceeds the required length.

11. In terms of page design, note that the width of the text box is the same as that of the drop-down box.

12. In terms of page Jump, note that you can use the method to submit to this page and identify different parameters to display different data and pages.

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.