Presentation is loading. Please wait.

Presentation is loading. Please wait.

Eclipse is an open source IDE (Integrated Development Environment) for developing applications in Java, C/C++, HTML, Cobol, Perl, etc. The official Eclipse.

Similar presentations


Presentation on theme: "Eclipse is an open source IDE (Integrated Development Environment) for developing applications in Java, C/C++, HTML, Cobol, Perl, etc. The official Eclipse."— Presentation transcript:

1 Eclipse is an open source IDE (Integrated Development Environment) for developing applications in Java, C/C++, HTML, Cobol, Perl, etc. The official Eclipse web site (eclipse.org) says, “Eclipse is a kind of universal tool platform -- an open extensible IDE for anything and nothing in particular.” Building a J2EE Web Application with Eclipse

2 Provides a consistent feature set on most platforms Supports more than just Java or any single language Open source and free, yet fully supported Truly extensible and configurable Industrial strength Building a J2EE Web Application with Eclipse Eclipse:

3 Web browser Web server HTML request Scripted pagedatabase Recall the typical dynamic web application consists of a web browser, web server, html pages, server pages, and a database Eclipse can be used to create the HTML pages, Server Pages, Database Tables, and test it all using a Web Server and a internal web browser. Overview of a Typical Web Application HTML

4 Web browser Web server HTML request Scripted pagedatabase The following components are used: Apache Jakarta Tomcat servlet engine Derby JavaServer Pages Standard Tag Library (JSTL) WTP (Web Tools Project Plugin) Eclipse support for creating an Testing Web Applications HTML

5 Web browser Web server HTML request Scripted pagedatabase The following components will be used: Apache Jakarta Tomcat servlet engine Derby JavaServer Pages Standard Tag Library (JSTL) WTP Apache Jakarta Tomcat servlet engine Derby JavaServer Pages Standard Tag Library (JSTL) Eclipse support for creating an Testing Web Applications Internet Explorer, Firefox, or internal browser HTML

6 Building J2EE Web Applications with Eclipse When Eclipse is started, it asks you to choose a workspace. The workspace is the location on the filesystem (folder, directory) where your files will be stored. Afterwards you are presented with the Welcome screen if this is your first time using this workspace.

7 Building J2EE Web Applications with Eclipse On the welcome screen there is an Overview…

8 Building J2EE Web Applications with Eclipse … Tutorials

9 Building J2EE Web Applications with Eclipse … Samples

10 Building J2EE Web Applications with Eclipse And a section on What’s New.

11 Building J2EE Web Applications with Eclipse Eclipse is divided into Perspectives and Views. A Perspective is the set of screens and functionality for a particular development scenerio (Java, C++). To build a Web Application, first set the perspective to J2EE by selecting Window -> Open Perspective -> Other

12 Building J2EE Web Applications with Eclipse Select J2EE.

13 Building a J2EE Web Application with Eclipse Next Create a Dynamic Web Project by selecting New -> Dynamic Web Project

14 Building a J2EE Web Application with Eclipse Type in a name for the Project. In this case it is FirstWebProject and press Finish. (May be asked to configure a Server)

15 Building a J2EE Web Application with Eclipse A folder will be created for your Project, appearing under Dynamic Web Projects

16 Web browser Web server HTML request Scripted pagedatabase The following components will be used: Apache Jakarta Tomcat servlet engine Derby JavaServer Pages Standard Tag Library (JSTL) WTP Apache Jakarta Tomcat servlet engine Derby JavaServer Pages Standard Tag Library (JSTL) Eclipse support for creating an Testing Web Applications Internet Explorer, Firefox, or internal browser

17 DERBY http://db.apache.org/derby - Relational Database implement in Java - Open source version of IBM Cloudscape - Small footprint - Provides an embedded driver

18 Using the Derby Database for Persistent Data Adding the Apache Derby Nature to the project makes the class files and tools for Derby available to the Project.

19 Using the Derby Database for Persistent Data Start the Derby Server by right-clicking on the Project and selecting Apache Derby -> Start Derby Network Server. Select Ok when the dialog box appears.

20 Using the Derby Database for Persistent Data To create a Database, create a script file and execute it. To create the file, right- mouse click on the project and choose New -> File

21 Using the Derby Database for Persistent Data Type in the name of an sql script file.

22 Using the Derby Database for Persistent Data Type the SQL for creating the table and inserting data.

23 Using the Derby Database for Persistent Data To execute the script, right-mouse click on the script file, choose Apache Derby -> Run SQL Script using ‘ij’

24 Using the Derby Database for Persistent Data The console shows the results of executing the script file. There is a Database Explorer for further manipulating the database.

25 Web browser Web server HTML request Scripted pagedatabase The following components will be used: Apache Jakarta Tomcat servlet engine Derby JavaServer Pages Standard Tag Library (JSTL) WTP Apache Jakarta Tomcat servlet engine Derby JavaServer Pages Standard Tag Library (JSTL) Eclipse support for creating an Testing Web Applications Internet Explorer, Firefox, or internal browser HTML

26 UML Class Diagram > main addaccount showaccounts

27 > UML Class Diagram addaccount addaccountToDBconfirmanAdd accountInfo

28 Creating HTML Pages / Server Pages To create a HTML page, right-click on the project and select New -> HTML

29 Type a filename and press Finish. Creating HTML Pages / Server Pages

30 Type a filename and press Finish. Creating HTML Pages / Server Pages

31 Enter HTML for the main menu page. Creating HTML Pages / Server Pages

32 Enter HTML for the main menu page. Creating HTML Pages / Server Pages

33 To view the page in a web browser, choose right-mouse click on the editor and choose Run As -> Run on Server. This will start Tomcat (if it is not started) and open the file in the browser. Creating HTML Pages / Server Pages (May have to choose Server and select Projects to add to the Server)

34 Creating HTML Pages / Server Pages The page displays in Eclipse’s internal Web browser.

35 Creating HTML Pages / Server Pages To change the web browser Eclipse uses, choose Window -> Preferences -> General -> Web Browser -> Use External browser, and choose the browser you would like used to display the pages (IE, Firefox, etc).

36 Creating HTML Pages / Server Pages Let’s create the addaccount.html

37 Creating HTML Pages / Server Pages

38

39

40 Here’s what we have so far, viewed with the internal web browser. Selecting the Add Account hyperlink takes us to the addaccount.html page.

41 Creating HTML Pages / Server Pages Here it is viewed with Internet Explorer.

42 > UML Class Diagram addaccount addaccountToDBconfirmanAdd accountInfo

43 > addaccountToDBconfirmanAdd accounts

44 Web browser Web server HTML request Scripted pagedatabase The following components will be used: Apache Jakarta Tomcat servlet engine Derby JavaServer Pages Standard Tag Library (JSTL) WTP Apache Jakarta Tomcat servlet engine Derby JavaServer Pages Standard Tag Library (JSTL) Eclipse support for creating an Testing Web Applications Internet Explorer, Firefox, or internal browser HTML

45 JSTL (JavaServerPages Standard Tag Library) The JSP Standard Tag Library (JSTL) is a collection of custom tag libraries that implement general-purpose functionality common to Web applications, including iteration and conditionalization, data management formatting, manipulation of XML, and database access. Core Tag Library – looping, expression evaluation, basic input/output Formatting/Internationalization Tag Library – parsing data, such as dates. Database Tag Library – tags that can be used to access SQL databases XML Tag Library – tags can be used to access XML elements

46 JSTL (JavaServerPages Standard Tag Library) Count to 10 Example (using JSTL) Core Tag Library Example

47 JSTL (JavaServerPages Standard Tag Library) SELECT CITY_NAME, COUNTRY, AIRPORT FROM APP.CITIES ORDER BY \ CITY_NAME, COUNTRY Database Tag Library

48 Let’s create the addAccountToDB page. Select New -> JSP

49 Type in a name

50 Default page

51 Type JSTL

52 Here’s what we have when viewed with the internal web browser

53 ... And with Internet Explorer


Download ppt "Eclipse is an open source IDE (Integrated Development Environment) for developing applications in Java, C/C++, HTML, Cobol, Perl, etc. The official Eclipse."

Similar presentations


Ads by Google