Struts environment configuration hand
1.ECLIPSE download URL: http://www.eclipse.org/
2.Tomcat download URL: http://jakarta.apache.org/site/binindex.cgi
3.Struts download URL: http://jakarta.apache.org/site/binindex.cgi
4.Tomcat for Eclipse plugin download URL: http://www.sysdeo.com/eclipse/tomcatplugin.html
5.easy struts plugin download URL: http://sourceforge.net/projects/easystruts
6. EJB Development Tools Lomboz (not required) Download URL: http://www.objectlearn.com/
The com.sdeo.eclipse.tomcat_2.2.1 in the above 4 and the com.cross.easystruts.eclipse_0.6.4 of the above 5 are copy to eclipse / plugins /, and then do the following settings
1. Tomcat's initialization setting: Start Eclipse, open the Settings window by menu Windows-> Preferences to select Tomcat and configure the Configuration 2.Easy Struts Initialization Settings: Start Eclipse, open the Settings window through the menu Windows-> Preferences to select Struts 1.1 and in Struts 1.1 Required library files and add struts.jar files 3. Type library description files required in Struts 1.1 It is recommended to join the three description files mentioned earlier: struts_html.tld, struts_bean.tld, struts_logic .tld, these three files automatically copy to the project's web-inferiology when creating a struts application project. 4. Create a Tomcat project, then right-click Project-> Properties-> Libraries, join all the package in Struts 1.1 to 5. New Add Easy Struts Support 6. All the package in Struts 1.1 COPY to Project-> Web-INF / Lib /
Use Java to connect SQL Server 2000 to get data 1. Download JDBC for SQLServer driver: http://www.microsoft.com/downloads/details.aspx?familyid=4f8f2f01-1ed7-4c4d-8f7b-3d47969e66ae&displaylang=en#filelist Click Setup Download driver 2. After downloading, install it with the default settings, will be installed to: C: / Program Files / Microsoft SQL Server 2000 Driver for JDBC 3. Put C: / Program Files / Microsoft SQL Server 2000 Driver for JDBC / LIB's mssqlser.jar, msbase.jar, msutil.jar three files copied to your JDK home directory / jre / lib / ext, now the JDBC driver is configured 4. Compilation Test: String Drivername = "com.microsoft.jdbc.sqlserver.SQLServerDriver"; String connURL = "jdbc: microsoft: sqlserver: // BLUESKY: 1433; User = sa; Password = sa; DatabaseName = sitedb"; try {Class.forName (driverName) ; Connection conn = DriverManager.getConnection (connURL); Statement stmt = conn.createStatement (); StringBuffer strsql = new StringBuffer (); strsql.append ( "select * from uSERTABLE where username = '" username "'"); ResultSet R s = stmt.executeQuery (strsql.tostring ()); if (! rs.next () ||! password.equals (rs.getstring ("Password")). Trim ())) {dbmsg = "Sorry The user you entered does not exist or the user password is incorrect. rs.getstring ("deleteright"); updateright = nulltostring (rs.getstring ("Updateright");}
} catch (ClassNotFoundException EX) {EX.PrintStackTrace ();} catch (sqlexception ex) {ex.printstacktrace ();} You can start doing Struts !!!