Complete database increasingly deleted Struts programs

zhaozj2021-02-16  50

First, development and operational environment:

WindowsXP JBuilder9.0 JBoss3.0 Oracle9i Sturts1.1

Second, the technique involved:

JDBC, Struts Chinese Issues, Message Management Error Display Features

Third, the program structure:

Figure

1

Procedure flow chart

Fourth, the program is briefly described:

1. After using the ResultSet from the database, after the HashMap and ArrayList package, pass it to the JSP page, and use in the JSP page.

2. Add, delete, and edit the function, jump to QueryDataAction.do, automatically refresh the changed record.

3. Add, delete the function can be done in one page without jump to other pages.

4. Delete and editing functions use links in EditData.jsp to import the next step.

5. Problems encountered in writing:

1. Database link Returns Nullexception error: Call connection is no write data source name (the key attribute of DataSource in Configure)

2. How to display the parameters passed by the previous Action in the Text Control:

I use the first example of struts to call the ActionForm's set method in the action.

3. Database Submit Chinese Problem: Solving the SETFILTER mode found online (configure it in web.xml)

4. Properties resource file Chinese problem:

Compile the Properties file method to resolve, use the following command to compile the file into a UTF8 format:

Native2ASCII -Encoding Utf8 a.properties Application.properties

5. The Edit function is to pass the information to editdetailction using a link mode, and the Chinese parameter passes garbled problem: use the following encoded conversion function to get it.

// Character encoding conversion function

Public Static String Convert (String Str) {

Try {

Byte [] bytestr = str.getbytes ("ISO-8859-1");

Return New String (bytestr, "utf8");

}

Catch (Exception EX) {

Return Str;

}

}

转载请注明原文地址:https://www.9cbs.com/read-24355.html

New Post(0)