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.