| Home | JSP | EJB | JDBC | Java Servlets | WAP | Free JSP Hosting | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML | ||||
|
||||
|
|
||||
| Tutorial Categories: Ajax
| Articles
| JSP
| Bioinformatics
| Database
| Free
Books |
Hibernate
| J2EE
| J2ME
| Java
| JavaScript
| JDBC
| JMS
| Linux
| MS
Technology |
PHP
| RMI
| Web-Services
| Servlets
| Struts
| UML
|
|
J2EE Web projects and applications In the WebSphere Studio workbench, you create and maintain resources for Web applications in Web projects. There are two types of Web projects, J2EE and static. J2EE web projects contain dynamic J2EE resources such as servlets, JSPs, filters, and associated metadata, in addition to static resources such as images and HTML files. Static web projects only contains static resources. When you create Web projects, you can include cascading style sheets and JSP tag libraries (for J2EE projects), using the Create a Web Project wizard, so that you can begin development with a richer set of project resources. J2EE Web projects are always imbedded in Enterprise Application projects. The wizards that enable you to create a Web project or to import a WAR file require that an Enterprise Application project be specified. When you complete these wizards, they will update the application.xml deployment descriptor of the specified Enterprise Application project to define the Web project as a module element. J2EE conventions may represent extra overhead if you only want to create a static, content-based Web application, which contains no dynamic files, such as JSPs or servlets. In this case, when you only need the most basic functions of a WebSphere Studio Web project, you may prefer to use the static Web project type. Static Web projects can later be converted to J2EE Web projects. The J2EE model, and more specifically, the Sun Microsystems Java Servlet 2.3 Specification, defines a Web application directory structure that specifies the location of web content files, class files, classpaths, deployment descriptors, and supporting metadata. The Web project hierarchy mirrors that of the Web application created from a project. In the workbench, you can use the Create a Web Project wizard to create a new Web project.
![]() The main project folder contains all development objects related to a Web application. The Web Content folder contains the elements of the project necessary to create a Web application. This folder structure maps to the Web application archive (WAR) structure defined by Sun. The following default elements are located in the Web project folder hierarchy: Web Deployment Descriptor - The standard Web application deployment descriptor. Java Source - Contains the project's Java source code for classes, beans, and servlets. When these resources are added to a Web project, they are automatically compiled and the generated files are added to the WEB-INF/classes directory. The contents of the source directory are not packaged in WAR files unless an option is specified when a WAR file is created. Web Content - The mandatory location of all Web resources, including HTML, JSP, graphic files, and so on. If the files are not placed in this directory (or in a subdirectory structure under this directory), the files will not be run on the server. The Web Content folder represents the contents of the WAR file that will be deployed to the server. Any files not under the Web Content folder are considered development-time resources (for example, .java files, .sql files, and .mif files), and are not deployed when the project is unit tested or published. META-INF - This directory contains the MANIFEST.MF file, which is used to map classpaths for dependent JAR files that exist in other projects in the same Enterprise Application project. An entry in this file will update the run-time project classpath and Java build settings to include the referenced JAR files. theme - The suggested directory for cascading style sheets and other style-related objects. WEB-INF - Based on the Sun Microsystems Java Servlet 2.3 Specification, this directory contains the supporting Web resources for a Web application, including the web.xml file and the classes and lib directories. /classes - This directory is for servlets, utility classes, and the Java compiler output directory. The classes in this directory are used by the application class loader to load the classes. Folders in this directory will map package and class names, as in: /WEB-INF/classes/com/mycorp/servlets/MyServlet.class. Do not place any .class files directly into this directory. The .class files are placed in this directory automatically when the java compiler compiles java source files that are in the Java Source directory. Any files placed directly in this directory will be deleted by the java compiler when it runs. /lib - The supporting JAR files that your Web application references. Any classes in .jar files placed in this directory will be available for your Web application Libraries - The supporting JAR files that your Web application references. This folder mirrors the content of the lib folder. In addition, Web Library Projects, which are "virtual" JAR files that do not physically reside in the Web project, but are associated with Java projects elsewhere in your workspace, are included in this folder. They are packaged with your project when you export the application's WAR file. Note: A library entry on the Java build path will remain there unless the actual JAR file is deleted from the WEB-INF/lib folder. If you remove a library path entry but not the JAR file, the library entry will be re-added to the path automatically. Creating an enterprise application project Enterprise application projects contain references to the resources needed for enterprise applications and can contain a combination of Web modules, JAR files, connector modules, EJB modules, and application client modules. An enterprise application project is deployed in the form of an EAR file. In WebSphere Studio, the modules in an enterprise application project are mapped to other J2EE projects. The mapping information is stored in metadata files within the enterprise application project. The metadata files are used for exporting the project to an EAR file, and for running the project on the server. Complete the following steps to easily create an enterprise application project:
New Enterprise Application project (EAR project, Application Client project, WAR project):
![]() Creating new J2EE Web projects In the workbench, you create and maintain resources for Web applications in Web projects. Use the Create a Web Project wizard to create a new J2EE Web project, as follows:
|
|
|
|||||||
|
|||||||
|
Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com. |
|||||||
|
Copyright © 2004. All rights reserved. |
|||||||