Exforsys.com
 
Home Tutorials J2EE
 

How To Create a Java Server Application

 

How To Create a Java Server Application

The invention of the internet and web browsers has had a massive impact on the way people send and receive information. If you are like many people, you probably get your news and other important information from the internet.



However, there are some limits to what web browsers can do. Because they are dependent on HTTP, they are heavily limited in their capabilities. Those who work with web applications on a daily basis are well aware of the many problems web browsers have which are dependent on HTTP. They are trying to improve this with what is called Web 2.0. In addition to Web 2.0, other applications such as Lazlo, Flex, and AJAX are being used as well.

The purpose of these tools is to enhance the abilities of thin web applications. However, there are some methods for doing this which are better than others. Both web applications and desktop programs each have their strengths and weaknesses. It is best to design a thick client for your users while simultaneously maintaining a standard J2EE/Web program structure. In this tutorial I will show you how to do this effectively. We will be using a stock trading program as an example. Before you get started, there are a number of things you will need. You will need a J2EE web server, Eclipse 3.1.2, Java 5, MyEclipse 4.1.1, and a servlet container. You will also need Spring 1.2+. You are also required to have an advanced understanding of these tools.

Before we start, you will want to make sure you are working with the JDK instead of just the JRE. To do this, you will want to go to "Windows" and look under "Preferences."You will now want to open the "Java" node and click on the menu which says "Installed JRE." You will now want to click on "Add" and then click on the "Browse" menu under the "JRE Home Directory." After you've done this, you will want to look at the Java_Home directory. Once you find it, click "Ok." Now you will want to key in "JDK" under "JRE Name." Once you've done this, you will want to click on the "Ok" button. It is also important to make sure the "JDK" box is checked. Clicking ok will allow you to exit the Windows/Preferences menu.

For this illustration we will be using a program called Tomcat. When you install Tomcat, it is important to make sure this program is installed in a nonwhite directory. For example, c:\Program Files\Java will not work correctly. The RMI Server will not work with Tomcat unless it is installed with no spaces. An example of where you can install Tomcat is c:\devtools\java\apache-file-6.6.18. As you can see, there are no white spaces. If you see anything which has white spaces, you will want to make sure it is corrected.

The program that you will want to work with next is called Spring. When you download Spring, make sure it has dependencies. The reason for this is because it will have some libraries that you will find to be useful. In addition to this, you will also want to download the javadoc and source. Once you are done downloading the file, unzip it. The next thing you will want to do is start a project for Java in Eclipse. To do this you will want to click on "File." Under File you will want to click on "New" and then "Project." Under "Project" you will want to pick "Java Project" and then press the "Next" button. When you do this, a "New Project Wizard" should appear on your screen.




Look under MyEclipse and then J2EE Projects. Under this menu, you will want to pick Web Project. Within this menu, you will want to click on Next. You will want to name this project Stocktradeserver. After this you will want to pick a location. After picking the location, you will want to click on the "Finish" button. Once you've accomplished this, you will want to add some new libraries. You will then want to combine the Spring Framework with your project. Doing this will allow you to successfully generate the Java server program. By doing this, you will dramatically increase the capabilities of your system. While standard web browsers may be limited because of HTTP, you can enhance their capabilites by using these steps.



Read Next: How To Create High Quality Tables With JavaScript



 

 

Comments


Astha said:

  I would like to know more about server applications. Giving examples would be Great.
Thanks . :-)
November 1, 2006, 1:24 pm

Rajesh Swami said:

  This is really helpful for us
thanks
wish u all the best
July 6, 2007, 8:49 am

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2010 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape