Struts Environmental Configuration Book (Eclipse Edition)

xiaoxiao2021-03-06  69

Struts Environmental Configuration

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 tool LOMBOZ (not required) ??

?? Download URL: ?? http://www.objectLearn.com/

Copy COM.SYSDEO.ECLIPSE.TOMCAT_2.2.1 in the above 4 and the com.cross.easystruts.eclipse_0.6.4 of the above 5

Eclipse / Plugins /, then make the following settings

1. Tomcat initialization setting: Start Eclipse, open the settings window through the menu Windows-> Preferences

?? Select Tomcat and configure

1.Easy? Struts Initialization Setting: Start Eclipse, open the setting window via menu Windows-> Preferences

?? Select Struts? 1.1 and find and add struts.jar files in the library file required for Struts? 1.1.

3. In the type library description file required for 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-inf directory when creating a struts application project.

4. Create a Tomcat project, then right-click Project-> Properties-> Libraries, add all the package in Struts? 1.1 Add / R

5. New add? Easy? Struts? Support

6. Put the package in Struts? 1.1 all COPY to Project-> Web-INF / LIB /

Use Java to connect SQL? Server? 2000 get data

1. Download the JDBC? For? SQLServer? Drive:

http://www.microsoft.com/downloads/details.aspx?familyid=4f8f2f01-1ed7-4c4d-8f7b-3d47969e66ae&displaylang=en#filelist

Click Setup.exe download driver

2. After downloading, install it with the default settings, will be installed:

??? c: / program? Files / microsoft? SQL? Server? 2000? Driver? For? JDBC

3. Put the C: / Program? Files / Microsoft? SQL? Server? 2000? Driver? For? JDBC / LIB

?? The following MSSQLSERVER. Jar, Msbase.jar, Msutil.jar three files copy to you

??? JDK home directory / jre / lib / ext, now JDBC driver is configured

4. Compile the running test program:

???????? String? Drivername? =? "Com.microsoft.jdbc.sqlserver.sqlserverdriver";

???????? String? Connurl? =? "JDBC: Microsoft: SQLServer: // Bluesky: 1433; user = sa; password = sa; databasename = SITEDB"; ???????? Try {

???????? classs.Forname (drivername);

???????? connection? Conn? =? Drivermanager.getConnection (connURL);

???????? statement? Stmt? =? Conn.createstatement ();

???????? StringBuffer? Strsql? =? New? StringBuffer ();

???????? strsql.append ("SELECT? *? from? utertable? where? usrname? = '" ? 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 ();

????????} cat? (SQLEXCEPTION? EX) {

????????????? EX.PrintStackTrace ();

????????}

Next, you can start doing Struts !!!

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

New Post(0)