JBoss.comEnterprise Documentation

Chapter 4. Developing a simple JSP web application

4.1. Setting Up the Project
4.2. Creating JSP Page
4.2.1. Editing a JSP Page
4.2.2. web.xml file
4.2.3. Deploying the project
4.2.4. JSP Page Preview
4.2.5. Launch JSP Project

Note:

We highly recommend developing in Seam. This chapter is for users who for some reason cannot use Seam.

In this chapter you'll find out how to create a simple JSP application using the JBoss Developer Studio. The application will show a classic "Hello World!" on the page.

We'll assume that you have already launched JBoss Developer Studio and also that the Web Development perspective is the current perspective. If not, make it active by selecting Window > Open Perspective > Web Development from the menu bar or by selecting Window > Open Perspective > Other... from the menu bar and then selecting Web Development from the Select Perspective dialog box.

The main purpose of this section is to tell you about creation a Dynamic Web Project.


A jspHello node should appear in the upper-left Package Explorer view.


This section covers all the points how to create, edit and then preview JSP page.

In our simple application we need to create only one JSP page which displays a "Hello World!" message.

In the next window you can choose a template for your jsp page and see its preview.


Our hello.jsp page will now appear in Project Explorer.

While creating any web project you could experience a pain writing ant scripts and managing the packaging even when writing the most trivial web applications. With JBoss Developer Studio you are saved from such a pain. All you need is to start JBoss server and launch your application in your favorite browser.

You can also create a war archive with JBDS's Archive Tools and export it to any web server.