Using Web Folder Mappings in Workshop for Weblogic
By Greg Stachnick-Oracle on Aug 27, 2008
In Workshop for Weblogic, we introduce Web Folder Mapping which seeks to broaden the types of project structures supported in the IDE. IDE’s supporting web development (including previous versions of Workshop ) often expect existing projects to conform to some sort of preferred project structure such as a WAR or EAR layout. Since only the runtime environments require a specific layout, many development teams choose to create an application using their own structure at design time and then construct and deploy the WAR/EAR during the build.
Through Web Folder Mapping, Workshop for Weblogic removes this IDE restriction by allowing you to map your design time project structure to the layout that would exist at runtime.
Typical Use Cases
In Workshop, web project setup now falls into two types of scenarios when working with existing projects. The first case is the traditional exploded WAR layout. This type of layout has been supported in all previous versions of Workshop and works by either enabling AppXRay on the project, assuming the project exists in the workspace, or importing the existing web application into Eclipse through the project creation wizards.
Web applications that do not conform to an exploded WAR structure and/or are spread out across multiple projects are setup just like any other project but include the additional step of mapping the project folders to their associated web application URI’s.
Setting up Web Folder Mapping
The following example project uses a non-WAR layout and has dependencies in a second project. In this case, the common JSP includes, images, and Struts actions are organized in a different project.
When we enable AppXRay on the project, the Web Folder Mapping wizard enables us to link the design time project structure to the structure that would exist at runtime.
Notice that the conf directory houses the deployment descriptors like web.xml struts-config.xml. At runtime these directories would likely reside in /WEB-INF.
Once the project folders have been mapped, all Workshop features, like AppXRay, WYSIWYG page construction, smart editors, and wizards, are available.
In this example, Struts actions configuration files are defined in both projects. AppXplorer consolidates the actions into a single list yet when we create a new action, we control where the new code resides.
Running with Weblogic Server Split Source
In addition to the support that web folder mapping brings to the IDE environment, we are also able to take this project and debug it on Weblogic Server without having to reorganize or repackage. This is because the web folder mapping information supports Weblogic Server’s split source feature.
Notice that the mapped project is running directly from the workspace onto Weblogic Server 9.2.
When debugging a JSP, the breakpoint maps back to the page source in the appropriate project.