WebReference.com logo
tip archive  •   about  •   sitemap  •   contact  •   jobs  •   write for us  •   subscribe


[prev]

How to Create an Ajax Autocomplete Text Field [con't]

Technical Lead
Thomson Reuters (Markets) LLC
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Developing the Web Application

Create a New Dynamic Web Project

New Project dialog
New Project dialog

Eclipse supports two types of Web Projects: Static Web Projects and Dynamic Web Projects. We're interested in creating a Dynamic Web Project because it will include some Java components. To create the project, select File->New->Other from the main menu. Then expand the "Web" branch from the list of different project types. Select "Dynamic Web Project" and click the "Next" button to start the wizard:

Here's where we select our target server that we added earlier to the server list. A target server provides the container which will be used to execute our Web application. Moreover, it will provide a set of libraries (jars), added to the project classpath, which are needed to compile Web-related classes. For instance, to create a new Servlet, we need javax.servlet.* packages in order to compile it, since it's not a part of the JDK libraries. Had you not defined a server runtime via the Preferences dialog, you could still define one by clicking on the "New..." button. You can also select an existing project by using the "Browse..." button. Make sure that “Add module to an EAR project” isn't selected. EAR stands for "Enterprise ARchive" file, which is a file format used by Java EE for packaging one or more modules into a single archive. By default, the context root will be the same as the project name. This is used when you access the Web application with a URL, i.e. http://localhost:8080/Autocomplete. Click the "Finish" button to close the dialog and create the Autocomplete project or have a look at the next screens by clicking "Next" button:

New dynamic Web project dialog
New dynamic Web project dialog

Eclipse will create a "Java EE" perspective by default. A perspective is an IDE layout associated to a particular type of development project. The perspectives are selected in the upper right-hand corner above the "Outline" tab. You can compare the Java EE perspective to the "Java" one by clicking on the Java button, immediately to the right of the Java EE one. You'll notice that some of the tabs on left-hand and bottom tabs will change. For instance, the Server tab will disappear and a Javadoc one will appear that wasn't visible in the Java EE perspective.

Eclipse IDE with Web project
Eclipse IDE with Web project

In the Project Explorer pane on the right, you'll see your newly created "Autocomplete" Java Web Project. Under the project are the following folders:

In the next installment we'll be building the Java classes that will handle the AJAX calls from the Autocomplete control. Until then, here's some further reading to get you thinking in Java!

References

Original: March 26, 2008

Digg This Add to del.icio.us


[prev]

Recent Articles

WebReference.com site name
Rolling Out Your Own HTML Application Version Control
HTML 5: Client-side Storage
Working with Ajax Server Extensions
internet.com site name
Wi-Fi Product Watch, November 2009
Chip Market Recovering From '08 Collapse
Low-Cost Tools to Kickstart Your New Business


internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs