« Home « Chủ đề ứng dụng java

Chủ đề : ứng dụng java


Có 40+ tài liệu thuộc chủ đề "ứng dụng java"

WebSphere Studio Application Developer Version 5 Programming Guide part 19

tailieu.vn

<element name="FIRSTNAME">. <element name="LASTNAME">. <element name="USERID">. <element name="PASSWORD">. <element name="ADDRESS">. Notice the Graph page of the XML schema editor (Figure 6-14). It shows the structure of the XML schema file.. To create a new database you have to have a project. To create database objects you have to switch to the Data perspective and open the Data Definition view.. To...

WebSphere Studio Application Developer Version 5 Programming Guide part 20

tailieu.vn

Select the ITSOTEST.sql file and Run on Database Server . Select the statements that you want to execute.. On the next page, set the commit option, for example, Commit changes only upon success (Figure 6-27).. On the connection page, create a connection to the ITSOTEST. Using a DB2 Command Window you can verify that the objects are created:. There are...

WebSphere Studio Application Developer Version 5 Programming Guide part 21

tailieu.vn

To test the statement, select it in the Statements folder and Execute (context) or select SQL ->. Execute in the menu bar.. Enter 'C' as the value for the :type and '%o%' as the value for the :lastname variables in the Host Variable Values window and click Finish to execute the query. The matching rows from the database are shown...

WebSphere Studio Application Developer Version 5 Programming Guide part 22

tailieu.vn

The color of the table rows alternate for readability reasons.. Finally, if anything goes wrong in the regular flow of events, the exception page is shown to inform the user (Figure 7-6).. In the example shown in Figure 7-6, we entered an invalid customer ID.. We will use a copy of the facade in the Web application. It is better...

WebSphere Studio Application Developer Version 5 Programming Guide part 23

tailieu.vn

Changes in the Design and Source views will automatically update each other, as well as the preview view. You can also preview your page using an external Web browser by selecting Tools ->. Alternatively, you can choose to have Application Developer automatically do this for you, a setting that can be platform-wide ( Window ->. Validation , on the Web...

WebSphere Studio Application Developer Version 5 Programming Guide part 24

tailieu.vn

Application Developer wizards not only support you in creating servlets, JSPs, and JavaBeans, but they also compile the Java code and store the class files in the correct folders for publishing to your application servers. You can test the resulting project resources within the Application Developer using the WebSphere Test Environment, or any other configured server that supports the chosen...

WebSphere Studio Application Developer Version 5 Programming Guide part 25

tailieu.vn

This page lets you supply page directive information for the JSP file:. First of all, add the packages java.util and itso.bank.model to the imports list by clicking Import Package once for each package.. The wizard’s fourth page lets you supply the JSP encoding, DOCTYPE, and style sheet information, just like when we created our HTML page.. Leave the options to...

WebSphere Studio Application Developer Version 5 Programming Guide part 26

tailieu.vn

The default selection is correct and clicking OK defines a server project named Servers, a server named WebSphere v5.0 Test Environment, and starts the server. The drawback of this method is that we cannot select a name for the server and we cannot tailor the server before it starts.. Stop the server, delete it from the Server Configuration view and...

WebSphere Studio Application Developer Version 5 Programming Guide part 27

tailieu.vn

All the default values are suitable, just click Finish to complete the wizard. The listener is created and added to the Web deployment descriptor. Switch to the Java editor that was opened on the HttpSessionInspector.java file. It handles the printing of messages to the standard output (Figure 7-51).. Now enter the life-cycle methods for the HttpSessionListener interface (Figure 7-52).. Figure...

WebSphere Studio Application Developer Version 5 Programming Guide part 28

tailieu.vn

244 WebSphere Studio Application Developer Version 5 Programming Guide. Note that if you rename the files, you have to configure the initialization parameters of the controller servlet (ListAccountsController) in the web.xml deployment descriptor.. In this chapter we learned about Application Developer’s facilities for creating static and dynamic Web applications. We also used the JavaBean Web Pages Wizard to generate a...

WebSphere Studio Application Developer Version 5 Programming Guide part 29

tailieu.vn

Here you can change the heading of the columns and page properties. If you do not want to show one or more of the fields retrieved from the query, you can deselect them in the top left pane. Typically, you would only select a subset of the fields for the master table.. To change the labels, select the item in...

WebSphere Studio Application Developer Version 5 Programming Guide part 30

tailieu.vn

The jspsql.jar file contains the tags and dbbeans.jar contains the actual classes used to access the database.. You can use the JSP editor to insert the database tags into your page when you are in the Design view. To be able to use the custom tags from the database tag library, you first have to do two things:. Import the...

WebSphere Studio Application Developer Version 5 Programming Guide part 31

tailieu.vn

Click Next and you are taken to the next page in the wizard. Here you specify the settings and the SQL statement. Click Change to update the SQL statement.. In the SQL Statement window (Figure 9-3), you have several options for entering an SQL statement:. We recommended that you use the SQL Statement Wizard by clicking SQL Assist (see “Using...

WebSphere Studio Application Developer Version 5 Programming Guide part 32

tailieu.vn

GetCustomerBean—Executes the stored procedure and provides a method to retrieve an array of GetCustomerBeanRow objects.. The generated JavaBean, GetCustomerBean, can be used in a servlet or JSP to execute the stored procedure and access the result set.. A simple JSP to execute the JavaBean is shown in Figure 9-16. Figure 9-16 Simple JSP to execute the JavaBean with the stored...

WebSphere Studio Application Developer Version 5 Programming Guide part 33

tailieu.vn

Struts is an open source framework for building Web applications according to the model-view-controller (MVC) architectural pattern. Struts is part of the Jakarta project, sponsored by the Apache Software Foundation.. The scope of this chapter is not to teach you the Struts framework in detail, but to show how to use Application Developer’s Struts tools for building a Struts Web...

WebSphere Studio Application Developer Version 5 Programming Guide part 34

tailieu.vn

On the Struts Settings page, select Override default settings. Change the Struts version to 1.1 (beta2).. Enter itso.strutsweb as the Default Java package prefix.. Leave itso.strutsweb.resources as the Java package for the resource bundle.. This action adds the new Web project to the server configuration.. Figure 10-8 Setting Struts properties. Java Source\itso.strutsweb.resources.ApplicationResources.properties. The Struts runtime classes (struts.jar and dependent JAR...

WebSphere Studio Application Developer Version 5 Programming Guide part 35

tailieu.vn

Because we use this form bean on multiple input pages, we have to know which of the fields should be validated. On the JSPs where this form bean is used, we pass an appropriate value for the validateKey so we can validate the data entered on that particular page only.. The validate method in a Struts form bean acts as...

WebSphere Studio Application Developer Version 5 Programming Guide part 36

tailieu.vn

Here are short instructions for the listAccounts JSP:. <bean:message key="prompt.account". tag for the customerInfoForm and replace the line with the following:. <bean:define id="customerInfoForm". <TITLE><bean:message key="text.pageTitle"/></TITLE>. <H2><bean:message key="text.customersAccounts". /></H2>. <html:errors/>. Note the <logic:iterate>. <logic:iterate id="accountNumbers_id". property="accountNumbers">. <TD><html:radio property='accountNumbers_id.accountNumbers' />. </TD>. </logic:iterate>. account number (accountNumbers_id), and the text after the button also to the account number, but retrieved using the <bean:write>. <bean:write>....

WebSphere Studio Application Developer Version 5 Programming Guide part 37

tailieu.vn

import itso.bank.exception.*;. import itso.bank.facade.*;. import itso.bank.model.*;. The code is shown in Figure 10-2.. Populate the CustomerInfo Form Bean for display. Store the bean in the correct scope if ("request".equals(mapping.getScope())). It then retrieves the form bean that Struts has populated before calling the execute method. The form bean is populated with all properties that Struts could retrieve from the input form...

WebSphere Studio Application Developer Version 5 Programming Guide part 38

tailieu.vn

344 WebSphere Studio Application Developer Version 5 Programming Guide. For example, if you select to transfer money between two accounts, but you do not enter either the amount or the destination account number, the validate method of the transactionForm form bean will report these two errors and you will be returned to the accountDetails.jsp page to correct the problem (Figure...