Struts Environment Configuration manual
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 Plug-in
Download URL: http://www.sysdeo.com/eclipse/tomcatPlugin.html
5.easy Struts Plugin
Download URL: http://sourceforge.net/projects/easystruts
6.EJB development tool Lomboz (not required)
Download URL: http://www.objectlearn.com/
Copy each of the above 4 com.sysdeo.eclipse.tomcat_2.2.1 and the com.cross.easystruts.eclipse_0.6.4 in the above 5 to
eclipse/plugins/, and then make the following settings
1.Tomcat initialization settings: Start Eclipse, open the Settings window via menu windows->preferences
Select Tomcat and do the configuration
1.Easy initialization settings for struts: Start Eclipse, open the Settings window via menu windows->preferences
Select Struts 1.1 and locate and add the Struts.jar file in the library files required for Struts 1.1
3. In the type library description required for Struts 1.1, it is recommended that at least the three described documents mentioned above be added to:
Struts_html.tld, Struts_bean.tld, Struts_logic.tld, these three files are automatically copied to the project's Web-inf directory when the Struts application project is created.
4. Create a new Tomcat project, then right-click Project->properties->libraries and add all of the packages in Struts 1.1
5. New Add Easy Struts Support
6. Copy all of the packages from Struts 1.1 to project->web-inf/lib/
Get data with Java Connection SQL Server 2000
1. Download the JDBC for SQL Server driver:
Http://www.microsoft.com/downloads/details.aspx?FamilyID=4f8f2f01-1ed7-4c4d-8f7b-3d47969e66ae&DisplayLang=en#filelist
Click setup.exe Download Driver
2. Install after downloading, install with default setting, will be installed to:
C:/Program Files/microsoft SQL Server Driver for JDBC
3. C:/Program Files/microsoft SQL Server Driver for Jdbc/lib
The following Mssqlserver.jar,msbase.jar,msutil.jar three files are copied to your
JDK Home directory/jre/lib/ext below, JDBC driver is now configured
4. Compile and run the test program:
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 rs = stmt.executequery (strsql.tostring ());
if (!rs.next () | |! Password.equals (Nulltostring (rs.getstring ("password")). Trim ()) {
Dbmsg = "Sorry, the user you entered does not exist or the user password is incorrect";
}else{
Username = nulltostring (rs.getstring ("username"));
Selectright = nulltostring (rs.getstring ("Selectright"));
Deleteright = nulltostring (rs.getstring ("Deleteright"));
Updateright = nulltostring (rs.getstring ("Updateright"));
}
}catch (ClassNotFoundException ex) {
Ex.printstacktrace ();
}catch (SQLException ex) {
Ex.printstacktrace ();
}
Struts!! go!!