DOC PREVIEW
K-State CIS 764 - Eclipse Tutorial

This preview shows page 1-2-3-20-21-22-41-42-43 out of 43 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Eclipse Tutorial Jeremy Skrdlant2005Table of ContentsSection 1: Installation Of EclipseInstallation Of Jboss IDEInstallation Of Jboss Section 2:Create a EJB 3.0 ProjectSection 3: Create an Entity BeanCreate a Session BeanSection 4:Create a ServletSection 5:Package the Application and deploying it.Section 1: InstallationGetting the ComponentsYou can install eclipse by going to eclipse.org and selecting the Download Link. Choose Eclipse SDK 3.1 for this tutorial. Next go to the JBoss web site and choose the downloadlink for version 1.5rc1. This is very important that it is this version or higher because the stable version does not have EJB 3.0 implemented yet. Download Sites as of 12-6-2005Eclipsehttp://eclipse.org/downloads/JBoss IDEhttp://www.jboss.org/products/jbosside/downloadsJBoss Application Serverhttp://www.jboss.org/products/jbossas/downloadsStep 1: Put the Eclipse zip file and the JBoss IDE zip file in the same directory and unzip both to the base of that directory. Your finished directory should look like this.Congratulations. You are done installing eclipse Step 2: Now you will need to go through a wizard to install JBoss 4.0.x onto your computer. I would recommend you use the Run Installer option on the website. Below is a picture of the website as of 12-6-2005 with the button mentioned above circled.Remember the Directory that you installed JBoss to. You will need that information later on.Section 2: Creating an EJB 3.0 ProjectStart up eclipse by double clicking the executable located in the eclipse folder that you extracted the eclipse source to. It should be /eclipse/eclipse from where your zip files are. The first thing that will happen is it will ask you for a directory to store all your projects in. This is not set in stone so it is not too big of a decision. Later on, if you want to change your workspace directory, simply go to File->Switch Workspace… There is also a Welcome screen at the beginning of operations. You can go ahead and close that out. It has some tutorials. It can always be accessed again by going to Help->Welcome.To create a new project, simply choose File->New->Project. A wizard will come up for you to choose which type of project. You should see a list of projects you can create. Choose the EJB3 and click on Next.The next step requires you to enter a name for the project. For this Tutorial, we will call it Tutorial1. After you have the name typed, press Next.The next part of the wizard will ask you for a JBoss Configuration. Go ahead and choosethe button that says Create a JBoss Configuration.You will see a Debug screen. In the left pane, double click on JBoss 4.0.x. This will create a New_Configuration. Rename this configuration to JBoss4-Tutorial. The next step you will need to do is press the Browse button and select the folder that you chose for your JBoss Installation. Click OK on the Browse For folder pop up and try to press the Apply button. Eclipse can be a tad buggy at this point. For some odd reason you need both JRE 1.4.2 and 1.5 . If you do not get a missing Jar file error then you can skip these next two steps about pointing eclipse to another JRE.Click on the Little Right arrow until you see the JRE tab. (This arrow is circled by red in the Picture) Next press the Installed JREs button.You will see a pop up that shows all the JRE’s that Eclipse found on your system which unfortunately is usually only 1 of them. Click on the Add button. You should see a smallwizard that asks for the base direction of the other JRE. If you had 1.5 to start with, then choose the 1.4 and vice versa for the people with 1.4 to start with.If the Project is accepted, click on the Close button to Close out the wizard.Finally choose the Configuration you just created and press Finish. Your Package Explorer should look like the one below when you have the folders expanded.Section 3: Session Bean and Entity BeansRight Click on the src folder and Choose New->Class.Give the Class a name of User. Make sure the Package is src and press Finish.Type in the following code into the User.java class. If it is not in the tabs, go to the package hierarchy and double click on User.java.On the Right side in the Outline, highlight both the components of User. Then right click and choose Source->Generate Getter and Setters.Make sure all the methods are selected and press Ok. Finally do some typing to get your source code to look like the following.//Beginning of source code. package src;import javax.persistence.Column;import javax.persistence.Entity;import javax.persistence.GeneratorType;import javax.persistence.Id;@Entitypublic class User {private String username;private String password;public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}@Id(generate = GeneratorType.AUTO)@Column(name="userName")public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}}//End of Source CodeRight Click on the src folder. Choose New->Other.A New Popup will appear. Choose the EJB3.0->Session Bean. Then press the Next button.Give the Bean a name of Users. Bean Package is src. (You can change that to whatever your heart desires.) Click the Finish button when you are through.In the Package Explorer, Double click on Users.java to get a tab for it in the src editing window. Then put in the method outlined by comments. You can add more methods but for this tutorial we are going to keep it simple and just have the one method. When you press the floppy to save the changes, you will notice an error on the UsersBean.java tab. This is there because the Interface is different from the class. We will take care of this issue in the next step.Press the UsersBean.java tab to get it to the front. Then right click in the blank space between the brackets. Choose Source->Override/Implement methodsAn implementation box will pop up. Make sure Users is checked. Then press OK.You will now notice that the loginUser method is in UsersBean.java. Before we can move on, we need to add some libraries.Right click on the Tutorial1 folder and select Properties.In the Properties Window, Select the Java Build Path in the left Frame. Then select the Libraries Tag.Click the Add Library button. And choose J2EE 1.4 Libraries (JBoss IDE)Then finally choose OK on the Main Properties window.Make your UsersBean look like the code below. //beginning of


View Full Document

K-State CIS 764 - Eclipse Tutorial

Documents in this Course
Load more
Download Eclipse Tutorial
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Eclipse Tutorial and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Eclipse Tutorial 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?