Class Material

Eclipse and Java Enterprise Edition with Bill Heitzeg

posted Nov 10, 2009 11:12 AM by Bill Heitzeg

Once you've completed the prerequisites, we're ready to get started.


Open up Eclipse
Perspectives, Views, Workspaces, and Working Sets
Create a new Dynamic Web Project
Java Enterprise Edition - two sides, the Web side and the EJB side.
It's Enterprise so remoting is important
Remoting - Web Side would be through something like web services, the EJB side would be java to java communications
Container managed beans, message beans
Hibernate is the EJB3 implementation for Entity Beans.
JARs, WARs, EARs

We're going to focus on the web side which is based on Servlets and JSP pages, both are generally served up over HTTP.

Create index.jsp (change the title and add some text)

Explain the Java Enterprise Edition containers and servers.

Get Tomcat running with Eclipse

Page, Session, Application, and Server scoping.

Add code to the JSP page
Make it output in the console
Make it output to the page

Create a new Class and call it inside the JSP
Static call
getter/setter generation using Eclipse
Call, instantiate, and finish

Create and show how a servlet works
Create a servlet and return a little HTML



Use a little JSTL
Use a little EL
A look at Session

EJBs
Frameworks that make it all a little easier.




Problem Solving

posted Oct 6, 2009 1:24 PM by Bill Heitzeg

1 A Copy the figure below and place the digits 1, 2, 3, 4, and 5  in these circles so
that the sums across (horizontally) and down (vertically) are the same.  Is there more
than one solution? 
 



1 B - Using the same diagram,  put the numbers 2, 3, 4, 5, and 6  in the circles to make the sum across and the sum
down equal to 12.  Are other solutions possible?  List at least two, if possible.

2 A - In a stock car race, the first five finishers in some order were a Ford, a Pontiac, a
Chevrolet, a Buick, and a Dodge.
·  The Ford finished seven seconds before the Chevrolet.
·  The Pontiac finished six seconds after the Buick.
·  The Dodge finished eight seconds after the Buick.
·  The Chevrolet finished two seconds before the Pontiac.
In what order did the cars finish the race?  What strategy did you use?

2 B - Four friends ran a race:
·  Matt finished seven seconds ahead of Ziggy.
·  Bailey finished three seconds behind Sam.
·  Ziggy finished five seconds behind Bailey.
In what order did the friends finish the race? 

3 A - The houses on Main Street are numbered consecutively from 1 to 150.  How Many house numbers contain at least digit 7?
3 B - How many house numbers contain the 7 digit if the house are numbered from 1 to 1000.

4 A - The figure below shows twelve toothpicks arranged to form three squares.  How
can you form five squares by moving only three toothpicks?



4 B - Sixteen toothpicks are arranged as shown.  Remove four toothpicks so that only four
congruent triangles remain.



1-2 of 2