-
Open Source Java Frameworks on NonStop User's Guide (Spring 3.0.2, Hibernate 3.5.1, MyFaces 2.0.2, Axis2/Java 1.5.2) HP Part Number: 641664-002 Published: February 2012 Edition: J06.03 and subsequent J-series RVUs and H06.06 and subsequent H-series RVUs.
-
© Copyright 2011 Hewlett-Packard Development Company, L.P. Legal Notice Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. The information contained herein is subject to change without notice.
-
Contents About This Document.....................................................................................8 Supported Release Version Updates (RVUs)..................................................................................8 Intended Audience....................................................................................................................8 New and Changed Information in This Edition..............................................................................
-
5 Getting Started with Spring....................................................................75 Prerequisites......................................................................................................................75 NonStop System...........................................................................................................75 Windows System...........................................................................................................75 Overview of EmpInfo...........
-
Modifying the Hibernate Application.............................................................................191 Enabling Browse Access...................................................................................................191 Hibernate Applications................................................................................................191 Spring and Hibernate Applications................................................................................
-
H Installing MyFaces Trinidad Framework Libraries on NonStop...................285 Downloading MyFaces Trinidad Distribution........................................................................285 Copying MyFaces Trinidad Runtime Libraries from Windows to NonStop.................................285 I Installing MyFaces Tomahawk Framework Libraries on NonStop.................286 Downloading MyFaces Tomahawk Distribution on Windows..................................................
-
Contract-First approach................................................................................................336 V Integrating Frameworks...........................................................................346 18 Using Spring Transaction Manager......................................................348 Why Transaction Management is required..........................................................................348 Spring Transaction Management...............................................
-
About This Document This manual provides information on how Spring, Hibernate, MyFaces, and Axis2/Java frameworks can be used to develop applications that can run on the HP NonStop™ platform. The frameworks are described with respect to their installation, configuration, and use on NonStop systems. For detailed information about a framework, see the links to online and public resources provided in the relevant sections.
-
prerequisite software and hardware required to install and configure Hibernate and Spring on NonStop systems.
-
Appendix E: Customizing Sample Applications This appendix details the customizations made in the Hibernate sample applications: Caveat Emptor and EventManager. Appendix F: JDBC Configuration This appendix describes the consolidated JDBC Type 2 driver configuration and the JDBC Type 4 driver configuration in the hibernate.cfg.xml and hibernate.properties files. Appendix G: Hibernate Environment Setup Script This appendix contains the ei_setenv script.
-
Notation Conventions General Syntax Notation This list summarizes the notation conventions for syntax presentation in this manual. UPPERCASE LETTERS Uppercase letters indicate keywords and reserved words. Type these items exactly as shown. Items not enclosed in brackets are required. For example: MAXATTACH Italic Letters Italic letters, regardless of font, indicate variable items that you supply. Items not enclosed in brackets are required.
-
{ } Braces A group of items enclosed in braces is a list from which you are required to choose one item. The items in the list can be arranged either vertically, with aligned braces on each side of the list, or horizontally, enclosed in a pair of braces and separated by vertical lines. For example: LISTOPENS PROCESS { $appl-mgr-name } { $process-name } ALLOWSU { ON | OFF } | Vertical Line A vertical line separates alternatives in a horizontal list that is enclosed in brackets or braces.
-
!i,o In procedure calls, the !i,o notation follows an input/output parameter (one that both passes data to the called procedure and returns data to the calling program). For example: error := COMPRESSEDIT ( filenum ) ; !i,o !i:i In procedure calls, the !i:i notation follows an input string parameter that has a corresponding parameter specifying the length of the string in bytes.
-
process-name State changed from old-objstate to objstate { Operator Request. } { Unknown. } | Vertical Line A vertical line separates alternatives in a horizontal list that is enclosed in brackets or braces. For example: Transfer status: { OK | Failed } % Percent Sign A percent sign precedes a number that is not in decimal notation. The % notation precedes an octal number. The %B notation precedes a binary number. The %H notation precedes a hexadecimal number.
-
Computer Type Computer type letters within text indicate case-sensitive keywords and reserved words. Type these items exactly as shown. Items not enclosed in brackets are required. For example: myfile.sh Bold Text Bold text in an example indicates user input typed at the terminal. For example: ENTER RUN CODE ?123 CODE RECEIVED: 123.00 The user must press the Return key after typing the input. [ ] Brackets Brackets enclose optional syntax items.
-
"{" module-name [, module-name]... "}" Item Spacing Spaces shown between items are required unless one of the items is a punctuation symbol such as a parenthesis or a comma. For example: DAY (datetime-expression) DAY(datetime-expression) If there is no space between two items, spaces are not permitted. In this example, no spaces are permitted between the period and any other items: myfile.
-
1 Introduction Java-based Web application development has been inundated by frameworks of every kind. There is a framework available for almost every application development requirement. The effort for developing an application using the framework approach is significantly less as compared to developing an application afresh. The efficiency of Java-based Web development can be increased by using the appropriate framework.
-
NonStop provides a highly scalable servlet/JSP container to host the web applications developed using the frameworks. Because the applications are deployed on NSJSP, the Java frameworks can leverage the following advantages of NonStop: • Scalability Scalability in NSJSP refers to its ability to increase its capacity to process a large number of requests simultaneously, by adding resources, such as additional processes and logical processors, to a system.
-
• JDBC Type 2 Driver for NonStop SQL/MX - enables Java applications to use HP NonStop SQL/MX to access NonStop SQL databases. • NonStop Server for Java (NSJ) - is a Java environment that supports compact, concurrent, dynamic, and portable programs for NonStop systems. NonStop iTP WebServer • You must have either of the following versions of iTP WebServer installed on the NonStop system: ◦ non-secure: version T8996H02 or later ◦ secure: version T8997H02 or later To verify the version: 1.
-
If you do not have iTP WebServer deployed on the NonStop system, create your own iTP WebServer deployment: 1. Go to the /usr/tandem/webserver/ directory on OSS: OSS> cd /usr/tandem/webserver 2. 3. Select the iTP WebServer version you want to deploy. Go to the version-specific iTP WebServer installation directory on OSS: OSS> cd where, is the version of the iTP WebServer you want to deploy.
-
For information on installing and setting up NSJSP on a NonStop system, see the NonStop Servlets for JavaServer Pages (NSJSP) 6.1 System Administrator's Guide. • NSJSP must be deployed on the NonStop system. ◦ ◦ If you have NSJSP deployed on the NonStop system, you should know: – Location of the iTP WebServer deployment directory under which NSJSP is setup. This location will be referred to as .
-
2.
-
For information on installing NSJ on a NonStop system, see the NonStop Server for Java 6.1 Programmer's Reference Manual. Windows System The following software must be installed on the Windows™ system: • Java Development Kit (JDK) - is a Java development tool kit, which includes the Java Runtime Environment (JRE) that enables you to run Java applications and applets. • Ant - is a Java library and command-line tool used to build Java projects. This tool is required to build Axis2/Java applications.
-
3. Click Environment Variables. A list of environment variables appears. 4. If the PATH and JAVA_HOME variables are listed in the User Variables dialog box, verify that: • The PATH variable includes the bin directory of . • The JAVA_HOME variable is set to . If the PATH and JAVA_HOME variables exist, but do not contain the respective directories, do the following: 1.
-
4. If the PATH and ANT_HOME variables are listed in the User Variables dialog box, verify that: • The PATH variable includes the bin directory of • The ANT_HOME variable is set to If the PATH and ANT_HOME variables exist but do not contain the respective directories, do the following: 1. Add \bin to PATH, separated by semicolon, and to ANT_HOME. For example: Add C:\ant1.7.
-
If the PATH and MAVEN_HOME variables exist but do not contain the respective directories, do the following: 1. Add \bin to PATH, separated by semicolon, and to MAVEN_HOME. For example: Add C:\apache-maven-2.2.1\bin to PATH and C:\apache-maven-2.2.1 to MAVEN_HOME. 2. 3. Click OK. Click Apply Changes. If the PATH and MAVEN_HOME variables do not exist, follow these steps: 1. Click New on the User Variables dialog box. 2.
-
1. Go to the \lib directory on the Windows system. command prompt> cd \lib For example: command prompt> cd C:\JDBCT4\lib 2. Verify that the version of JDBC Type 4 driver is T1249V11 or later: command prompt> java -jar t4sqlmx.jar Version procedure: T1249_V11_15MAY05_HP_NONSTOP(TM)_JDBCT4_2005_04_28 For information on installing JDBC Type 4 driver on a Windows system, see the HP NonStop JDBC Type 4 Driver Programmer's Reference Manual.
-
1. Add \bin to PATH, separated by semicolon, and to ACE_HOME. For example: Add C:\svn-win32-1.5.4\bin to PATH and C:\svn-win32-1.5.4 to ACE_HOME. 2. 3. Click OK. Click Apply Changes. If the PATH and ACE_HOME variables do not exist, follow these steps: 1. Click New on the User Variables dialog box. 2. Enter the variable name as PATH and variable value as \bin. 3.
-
8. Start the SVN server: command prompt> net start svnserver SVN 1.5.4 is now installed and running on the Windows system. NOTE: If want to use the Eclipse Galileo IDE, download the SVN plugin for Eclipse from http:// www.eclipse.org/subversive/downloads.php. Eclipse Galileo IDE You must have Eclipse Galileo IDE version 3.3.1.1 or a later installed on the Windows system. If you do not have the Eclipse Galileo IDE installed on your Windows system, download it from: http://archive.eclipse.
-
Part I Spring Framework Part I includes the following chapters: • “Spring Overview” (page 33) This chapter provides an overview of the following: • ◦ Spring projects certified for use on NonStop ◦ Deployment environment for a web application that is written using Spring and accesses data from the SQL/MX database. “Installing the Spring Framework” (page 36) This chapter helps you to install Spring framework libraries and enables you to deploy and run sample Spring applications on your NonStop system.
-
Contents 2 Spring Overview......................................................................................33 Spring Projects.......................................................................................................................33 Spring Framework..............................................................................................................33 Spring Web Flow...............................................................................................................
-
C JDBC Configuration................................................................................144 D Installing Spring Web Flow......................................................................146 Downloading Spring Web Flow Distribution on Windows..........................................................146 Copying Spring Web Flow Runtime Libraries from Windows to NonStop......................................
-
2 Spring Overview Spring is an open source framework that can be used to develop enterprise applications. Its features and functions are packaged in different modules, which facilitate Java application development. It includes a lightweight container that provides a centralized, automated configuration and wiring of your application objects. Spring includes the following: • A flexible MVC web application framework, built on core Spring functionality.
-
Spring Web Flow At times, web applications need to execute the same sequence of steps in different contexts. The Spring Web Flow can be used to implement such repetitive steps or flows because it integrates with the Spring Web MVC platform to provide a flow definition language. For information about downloading and installing the Spring Web Flow, see Appendix D: Installing Spring Web Flow.
-
instances listening on the port in a round-robin manner. If the RMI servers are distributed across all the processors it leads to RMI calls getting distributed across all the processors. NOTE: NonStop TCPIPv6 limits one process per processor to listen on any given port, while IP-CIP does not have any such restriction. 2. Spring applications accessing SQL/MX database. Spring web applications can be configured to access a SQL/MX database through the JDBC drivers (JDBC Type 2 or JDBC type 4 drivers).
-
3 Installing the Spring Framework This chapter describes the procedure to install Spring framework libraries on a Nonstop system. It also describes the steps required to deploy and run sample Spring applications, which help you to verify if you have successfully installed Spring on the NonStop system. The following tasks are described in this chapter: 1. “Installing Spring Framework Libraries on NonStop” (page 36) 2.
-
3. 4. “Downloading Sample Spring Applications on Windows” (page 38) “Copying Spring Runtime Libraries from Windows to NonStop” (page 39) NOTE: Throughout the chapter, references are made to the following directories: • : The directory on the Windows system where the Spring distribution files are extracted. • : The OSS directory on the NonStop system where the Spring runtime JAR files are located.
-
\src includes the source of the Spring framework. Downloading Spring Dependency JAR Files on Windows To download the Spring dependency JAR files on the Windows system, complete the following steps: 1. Go to http://www.springsource.com/download/community?project=Spring%20Framework. The Spring Community Downloads web page appears. 2. Do one of the following: 1. Register yourself. 2. Click I'd rather not fill in the form. Just take me to the download page. The Spring frameworks available for download appear.
-
Copying Spring Runtime Libraries from Windows to NonStop To copy the Spring runtime libraries from a Windows system to a NonStop system, complete the following steps: 1. Go to and create JAR files of \dist and directories on the Windows system: command command command command prompt> prompt> prompt> prompt> cd jar -cvf spring_dist.jar dist cd jar -cvf spring_dependency.
-
NOTE: The SAMPLES.zip file is distributed as a part of the NS Samples for Java Frameworks - T0874. SAMPLES.zip is present in the T0874AAB.BIN file in Scout for NonStop Servers. For information on how to install the T0874AAB.BIN file from Scout, see https://h20453.www2.hp.com/scout/ download_help.htm. Before you deploy the sample applications, complete the following steps: 1. Download the SAMPLES.zip file from Scout for NonStop servers. 2. Add the .zip extension to it. The file is renamed as SAMPLES.zip. 3.
-
2. Modify the jdbc.properties file to update the JDBC configuration. You can use either the JDBC Type 2 driver or the JDBC Type 4 driver. The SQL/MX settings for each of them is as follows: • To use the JDBC Type 2 driver, uncomment the SQL/MX settings for the JDBC Type 2 driver in the jdbc.properties file, so that the SQL/MX settings for JDBC Type 2 driver appear as: # Properties that control the population of schema and data for a new data source # SQL/MX Settings for JDBC Type 2 Driver jdbc.
-
4. Go to \spring\samples\petclinic\target and run the following commands: command prompt> cd \spring\samples\petclinic\target command prompt> jar uf petclinic.war WEB-INF\lib\hibernate3sqlmx.jar The hibernate3sqlmx.jar is copied to \spring\samples\petclinic\target\petclinic.war\WEB-INF\lib. • To use JDBC Type 4 driver: 1. Enter the following command: command prompt> mvn clean package The application WAR file (petclinic.
-
3. Copy the following scripts from the \spring\samples\petclinic\ src\main\resources\db\mxci\Windows directory to the /spring/samples/petclinic/dbconfig OSS directory: • petclinic_tables_script.sql • petclinic_dataload_script.sql NOTE: 4. • The petclinic_tables_script.sql script creates the SQL/MX database catalog, schema, and tables for PetClinic. • The petclinic_dataload_script.sql script loads the database with sample data.
-
Figure 2 NSJSP Manager Login Screen 2. Enter the User name: and Password: and click OK. The NSJSP Manager screen appears. Figure 3 shows the NSJSP Manager screen.
-
3. Select SERVLETS for the Server Class and click Set. The Host (in server.xml) tab is enabled and populated with localhost. Click Set, which enables the Deployment tab on the NSJSP Manager screen. Figure 4 shows the Deployment tab of NSJSP Manager. Figure 4 NSJSP Manager Screen - Deployment tab 4. In the Deployment tab, complete the following steps in the Web Application Deployment from Desktop section: 1. In the Select a .war file to upload field, click Browse... and locate the petclinic.
-
• Add a new pet to the system • View information about the pet's visit to the clinic JPetStore The intended users of the JPetStore sample application are Visitors and Shoppers. A Visitor is anyone who visits the site. A Shopper is an authenticated visitor who is signed in to the site. Visitors can browse the site for items of their interest. Shoppers can purchase items of their interest. This section describes the following steps for the JPetStore sample application.
-
jdbc.username= jdbc.password= jdbc.catalog=jpetstorecat jdbc.schema=jpetstoresch NOTE: must have access to the schema created for JPetstore. 3. Build the JPetStore WAR file (org.springframework.samples.jpetstore-1.0.0-SNAPSHOT.war). 1. Go to the \spring\samples\jpetstore directory: command prompt> cd \spring\samples\jpetstore 2. Build the JPetStore web archive using the JDBC Type 2 driver or JDBC Type 4 driver.
-
• : specify the location of the metadata tables for the catalog. For example: \NSK01.$data01. • : specify the designated subvolume name for the schema. For example: SASH2. NOTE: The subvolume name is always prefixed by ZSD and must have eight characters (including ZSD). 2.
-
1. Go to http://:/. The NSJSP Manager Login screen appears. Figure 5 shows the NSJSP Manager Login screen. Figure 5 NSJSP Manager Login Screen 2. Enter the User name: and Password: and click OK. The NSJSP Manager screen appears. Figure 6 shows the NSJSP Manager screen.
-
Figure 6 NSJSP Manager Screen 3. Select SERVLETS for the Server Class and click Set. The Host (in server.xml) tab is enabled and populated with localhost. Click Set, which enables the Deployment tab on the NSJSP Manager screen. Figure 4 shows the Deployment tab of NSJSP Manager.
-
4. In the Deployment tab, complete the following steps in the Web Application Deployment from Desktop section: 1. In the Select a .war file to upload field, click Browse... and locate the org.springframework.samples.jpetstore-1.0.0-SNAPSHOT.war file on the Windows system. 2. (Optional) In the Context name field, enter a name for the application context. 3. Click Deploy. JPetStore is deployed on NSJSP and is listed under Applications tab of the NSJSP Manager screen.
-
4 Configuring Spring Applications on NonStop Systems This chapter provides information about configuring Spring applications on NonStop systems and includes the following sections: • “NonStop Platform Configurations” (page 52) • “Spring Framework Configurations” (page 62) • “Module File Caching Configurations” (page 73) NonStop Platform Configurations On a NonStop system, an application developed using the Spring framework is deployed as a web application under the NSJSP container.
-
3. 4. 5. Set the value of Maxlinks to 250. This is the maximum number of links to the server process (NSJSP process). This means that the server process must be capable of processing 250 requests simultaneously. Set the value of TANDEM_RECEIVE_DEPTH to 250 (because the values of Maxlinks and TANDEM_RECEIVE_DEPTH should be equal). A value of 250 means that the NSJSP process is able to read a maximum of 250 messages simultaneously from its $RECEIVE file.
-
Configuring httpd Processes to Handle Maximum Load The httpd processes are configured using the Server configuration directive in the /conf/httpd.config file on OSS. The Server directive controls the creation of the PATHMON environment, where the webserver runs.
-
each of the five static processes can handle 100 requests. In this example, the capacity of the iTP WebServer environment can be summarized as follows: ◦ The static capacity of iTP WebServer is [Numstatic X TANDEM_RECEIVE_DEPTH]= 500. ◦ The dynamic capacity is [(Maxservers - Numstatic) X TANDEM_RECEIVE_DEPTH]= 4500. ◦ The total capacity of iTP WebServer is [Maxservers X TANDEM_RECEIVE_DEPTH]= 5000. Using this configuration, the iTP WebServer can handle 500 simultaneous requests statically.
-
After determining the values, you can use any the following approaches to make necessary configurations for the TS/MP parameters of the httpd processes: ◦ Using the default value of TANDEM_RECEIVE_DEPTH ◦ Modifying the value of TANDEM_RECEIVE_DEPTH Using the default value of TANDEM_RECEIVE_DEPTH With TANDEM_RECEIVE_DEPTH set to the default value of 50, the static processes can be configured on the basis of Average Load and dynamic processes can be configured on the basis of Peak Load on your system.
-
In this case, the iTP WebServer serves 105 requests (higher multiple of Numstatic nearest to the count value). Here, the 106th request displays the following error message: Maximum connections reached: The server reached its maximum configured capacity. with HTTP response code: 200 OK To customize the error message, create a new message ID error-maximum-connection. This customized message is displayed if the message configuration directive is used in the /conf/httpd.
-
NOTE: • The default value of -DSaveSessionOnCreation is false. -DSessionBasedLoadBalancing Enables or disables SessionBasedLoadBalancing. Syntax: -DSessionBasedLoadBalancing=[ true | false ] NOTE: The default value of -DSessionBasedLoadBalancing is set to true.
-
that can be processed simultaneously can be controlled by limiting the number of threads that NSJSP Connector can spawn. NOTE: A single connector can service multiple instances of the container. The connector must be configured such that it can spawn threads sufficient for all the container instances. In terms of configuration, the Host element in the server.xml configuration file represents a container that is serviced by the connector.
-
1. 2. 3. 4. 5. Numstatic – Determines the number of static NSJSP processes. Maxservers – Determines the total number of NSJSP processes. TANDEM_RECEIVE_DEPTH – Determines the handling capacity of each instance of NSJSP. Maxlinks – Determines the maximum number of TS/MP links. The number of simultaneous messages that can be delivered to an instance of NSJSP is determined by Maxlinks. NSJSP reads these many number of messages from the $RECEIVE file simultaneously. Number of Connector threads.
-
processing the timeout requests could still be busy. Therefore, the number of threads that must be configured is (25+25 = 50). NSJSP Configured with SessionBasedLoadBalancing Turned ON • The value of Numstatic must be [(Peak Load)/(Max load one instance of NSJSP can handle)]. • The value of Maxservers must be [(Peak Load)/(Max load one instance of NSJSP can handle)]. This ensures that no dynamic process is created, so that the session object is not lost when there are many File System calls.
-
Some of the important Java runtime arguments that you must consider during the deployment of your Spring applications are: • “-Xmx” (page 62) • “-Xss” (page 62) • “-Xnoclassgc” (page 62) There are other Java runtime arguments supported by NSJSP. For more information, see the NonStop Servlets for JavaServer Pages (NSJSP) 6.1 System Administrator's Guide. -Xmx Sets the maximum size of the memory allocation pool, which is the garbage collected heap.
-
Configuring JDBC Driver for SQL/MX Database The JDBC driver to be used when a Spring application (using Spring DAO) connects to the SQL/MX database needs to be specified in the applicationContext.xml and jdbc.properties file provided by the Spring framework.
-
Defining the placeholder for JDBC Type 2 Driver Class Modify the applicationContext.xml file to define a placeholder for the JDBC Type 2 driver class name com.tandem.sqlmx.SQLMXDriver from the jdbc.properties file as shown below. ${jdbc.driver} NOTE: It is recommended to use com.mchange.v2.c3p0.
-
Configuring JDBC Type 4 Driver for SQL/MX Database To configure JDBC Type 4 driver for connecting a Spring application with SQL/MX database, complete the following configurations: 1. “Configurations in the jdbc.properties File” (page 65) 2. “Configurations in the applicationContext.xml File” (page 65) NOTE: Verify and install JDBC Type 4 driver version T1249V11 by following the steps discussed in the “Installing the Spring Framework” (page 36) chapter. Configurations in the jdbc.
-
${jdbc.driver} NOTE: It is recommended that you use com.mchange.v2.c3p0.ComboPooledDataSource as the datasource class because it provides various parameters for connection pooling. Other available datasource classes are org.apache.commons.dbcp.BasicDataSource provided by Apache DBCP and org.springframework.jdbc.datasource.DriverManagerDataSource provided by Spring framework. Defining the Placeholder for Connection URL Modify the applicationContext.
-
Declarative Transaction Management This section describes the following steps to configure transactions in Spring applications using declarative approach: • “Defining the Transactional Object” (page 67) • “Defining the Transactional Advice” (page 68) • “Defining the Transactional Execution Point” (page 68) • “Defining the Transaction Datasource” (page 69) • “Defining the PlatformTransactionManager” (page 69) • “Defining the Transaction Rollback (Optional)” (page 70) NOTE: In a typical Spring app
-
Defining the Transactional Advice The next step is to add the transactional advice to the transactional object. The transaction semantics that must be applied are encapsulated in the definition.
-
In this case, the definition ensures that the transactional advice defined by the txAdvice bean actually executes at the appropriate points in the program. Define a pointcut that matches the execution of any operation defined in the MyService interface (myServiceOperation). Associate the pointcut with the txAdvice using an advisor. The result indicates that at the execution of a myServiceOperation, the advice defined by txAdvice will be run.
-
Defining the Transaction Rollback (Optional) This section describes the steps to control the rollback of transactions in a simple declarative fashion. The recommended way to indicate to the Spring framework transaction infrastructure that a transaction work must be rolled back is to throw an Exception from the code that is currently executing in the context of a transaction.
-
// use constructor-injection to supply the PlatformTransactionManager public SimpleService(PlatformTransactionManager transactionManager) { Assert.notNull(transactionManager, "The 'transactionManager' argument must not be null."); this.transactionTemplate = new TransactionTemplate(transactionManager); } public Object someServiceMethod() { return transactionTemplate.
-
2. might be a good approach. Being able to set the transaction name explicitly is also something that can only be done using the programmatic approach to transaction management. If your application has numerous transactional operations, declarative transaction management is usually worthwhile. It keeps transaction management out of business logic, and is not difficult to configure.
-
Minimum Pool Size The correct minimum value for the pool can be determined by examining the applications that are using the pool. If it is determined, for example, that at least four connections are needed at any point in time, the minimum number of connections should be set to 4 to ensure that all requests can be fulfilled without connection wait timeout exceptions. At off-peak times, the pool shrinks back to this minimum number of connections.
-
NOTE: You can configure any number of servers based on your requirement. If you do not specify the number of servers, the default value (maxserver=5, initserver=1, and idleserver=1) is assumed. 3. Stop the datasource: mxci>> stop ds MFC_datasource, reason 'test'; NOTE: status. 4. This step must be performed only if you have a configured datasource in the started To enable the MFC feature, add the statement_module_caching environment variable to the datasource: mxci>> add evar $mcbs."MFC_datasource".
-
5 Getting Started with Spring This chapter explains how to develop a web application using Spring. It describes the steps to build a basic employee management system on the Windows system and deploy it on the NonStop system.
-
Developing EmpInfo on Windows using the Eclipse Galileo IDE NOTE: • It is not mandatory for you to use the Eclipse Galileo IDE. You can use an IDE that supports Java. • The screen captures in this section are based on Eclipse Galileo IDE version 3.3.1.1. The screen captures might look different if you use a different version of Eclipse Galileo. The following activities are required to develop the EmpInfo application using the Eclipse Galileo IDE: 1. “Developing a Basic EmpInfo Application” (page 77) 2.
-
2. Click OK. To create a new workspace, click Browse and select the folder you want to use as the workspace. The Eclipse SDK Welcome screen appears. NOTE: D:\sash_usr\spring is the sample workspace used to develop the EmpInfo application. Figure 9 Eclipse SDK Welcome Screen Close the welcome screen. The workspace is created. NOTE: The source code for the EmpInfo application is in the SAMPLES.zip file.
-
Creating a Dynamic Web Project To create a new Eclipse project for the EmpInfo application, complete the following steps: 1. Click File> New> Project. The New Project dialog box appears. 2. From the list of folders, select Web > Dynamic Web Project and click Next. Figure 10 New Project Wizard Dialog Box The New Dynamic Web Project dialog box appears. 3. In the Project name field, type EmpInfo and click Finish. NOTE: 78 The other fields in the New Dynamic Web Project dialog box are selected by default.
-
Figure 11 New Dynamic Web Project Dialog Box When prompted, change the perspective to Java EE and click Yes to open the new perspective. NOTE: The perspective should be changed to Java EE because the Dynamic Web Project is associated with the Java EE perspective. The Project Structure appears. 4. In the Project Structure, confirm that the JRE System Library is set to JRE version 1.6 or later, as shown in Figure 12. If the JRE version is not set to 1.6, right-click JRE System Library to select JRE 1.6.
-
Figure 12 Project Explorer View Creating the index.jsp File Create the index.jsp file in the EmpInfo/WebContent directory. This JSP page is the entry point EmpInfo. To create the index.jsp file, complete the following steps: 1. On the Project Explorer frame, right-click EmpInfo and select New > Other. The New File dialog box appears. 2. 80 From the list of folders, select Web > JSP and click Next.
-
Figure 13 New File Dialog Box The New JavaServer Page dialog box appears. 3. In the File name field, type index and ensure that the parent folder is set to EmpInfo/WebContent. Click Next.
-
Figure 14 New JavaServer Page Dialog Box The New JavaServer Page: JSP Template dialog box appears. 4. From the Select JSP Template dialog box, select New JSP File (html) and click Finish. NOTE: 82 The Use JSP Template check box is selected by default.
-
Figure 15 New JavaServer Page: JSP Template Dialog Box The template for the index.jsp file is generated. Modifying the index.jsp File To modify the index.jsp file, complete the following step: • Modify the EmpInfo/WebContent/index.jsp file to add a header item. Add as the title tag, as the header item and within the body tag of the EmpInfo/WebContent/index.
-
Spring Getting Started with EmpInfo Application Welcome to the EmpInfo Application
This is EmpInfo Test Page.