Monday, December 2, 2013

Tomcat, Eclipse, MySql on Windows7

Download Tomcat7
  64-bit Windows zip
 C:\Program Files\apache-tomcat-7.0.47
Download Eclipse
 (note: I used 32bit version for integration with clearcase)


 Window > Preferences > Server > Runtime Environments > Add > Apache Tomcat v7.0
  [checked] Create a new local server
  > Next
  Name: Apache Tomcat v7.0
  Tomcat installation directory: C:\Program Files\apache-tomcat-7.0.47
  > Finish > Ok
 Select "Java EE" Perspective (top right)
 Select "Servers" Tab (bottom middle)
  New Server Wizard > Apache > Tomcat v7.0 Server > Finish

 File > New > Dynamic Web Project > proj1 > Finish

 proj1 > Web Content > [right-click] New > HTML File > index.html > Finish
 -- put "hello world" in the body of that file, and save it.

 [right-click] proj1 > Run As > Run On Server > Tomcat v7.0 Server at localhost (Stopped)
  [checked] Always use this server when running this project
  > Finish

The catalina.out appears in the Console tab.
The fact that your tomcat has been started and is running proj1 appears in the Servers tab.
Your hello world index.html appears rendered by an onboard browser in the center console.

Old Notes

java -version
## yes, I have ver 1.7, 64bit

download mysql > Windows (x86, 64-bit), MSI Installer > No thanks, don't register > Agree with everything except:
- best support for multilingualism
- include bin dir in win path
- root password

download tomcat > 32-bit/64-bit Windows Service Installer > Just agree

Eclipse was already installed (must be javaEE) > Select javaEE view (top right) > Select servers tab (bottom middle)
- New > Server > Apache tomcat 7
- File > New > Dynamic Web Project > myProj1
- myProj1 > Web Content > New index.html (containing hello world)

Had a weird problem with tomcat. Must manually stop it before runing app from eclipse. Works fine now.

Get started with JSF >

Eclipse > File > Import > General > Existing project into workspace > Archive file > right-click the newly created project > Properties > Server & Targeted Runtimes > Tomcat 7

copy web-inf/lib from sample to myProj1
rename index.html to home.xhtml
copy index.jsp from sample and change redirect ot home.jsf
also copy web.xml/faces-config-xml from sample to myProj1

More detail: (but I think this is out of date)

{ "loggedin": false, "owner": false, "avatar": "", "render": "nothing", "trackingID": "UA-36983794-1", "description": "", "page": { "blogIds": [ 362 ] }, "domain": "", "base": "\/michael", "url": "https:\/\/\/michael\/", "frameworkFiles": "https:\/\/\/michael\/_framework\/_files.4\/", "commonFiles": "https:\/\/\/michael\/_common\/_files.3\/", "mediaFiles": "https:\/\/\/michael\/media\/_files.3\/", "tmdbUrl": "http:\/\/\/", "tmdbPoster": "http:\/\/\/t\/p\/w342" }