Pustefix Helloworld
/\

This little pustefix howto helps you creating a small "hello world" application.
Questions ? here.


  1. Preconditions:
    • Some Unix. If possible, Linux. Even better: Gentoo :-)
    • Some Java. If possible, Sun

    • Your environment should provide the variable MAKE_MODE, if you don't want to give that parameter each build. For my gentoo box, I use /etc/env.d/20java . Insert
      MAKE_MODE="test"
      Run env-update, dont forget to update your running shells.
      Optionally, do only a manual export of that variable and use that shell as your build shell.

    • If you use a name server, configure it that it resolves all subdomains to your box.
    • If you don't use a name server, modify your /etc/hosts to fit the later used project names. Simply take the line of your current IP and name assignment, double it, and write in all the future pustefix projects :-) . For my case, it looks like
      192.168.0.10 neh local.neh data.neh 192.168.0.10 test3.neh test4.neh

    • Port 8080 should be free for usage. Pustefix/Tomcat like to use that port if no extra configuration was applied.

    What you do not need for this example:
    • Apache. Pustefix is to be stuffed with a tomcat, that will run independently.
    • mod_jk. No apache, no mod_jk
    • jikes. Jikes can be used, but if you did'nt install it yet, that's okay.
    • Eclipse. Any text editor will do it now. For real projects, Eclipse might be very helpful indeed, so I use it now as well.

  2. Download and extract
    • Download pustefix here . Here, we use pfixcore-skel-0.8.4.tar.gz .
    • Download tomcat: here , choose the 5.0 binary .tar.gz package. Version 5.5 has some changes with logging, that will fail the current pustefix to run properly.
    • Create a new project "helloworld" in eclipse
    • Extract the pfixcore package into the eclipse project directory.
    • Move everything from skel/ to the project main directory
      mv skel/* . rmdir skel

    • move or link the tomcat package into lib/tomcat .
    • In Eclipse, refresh your project now.

    • For that example we don't need jikes, since there are very little java files to be compiled. If you don't have installed it anyway open the build.xml and change the property "build.compiler" to "modern".


    • If you came that far, the project might look like this image:

    • run ant

  3. Create a new project
    • start ./newproject.sh
    • I used "helloworld" as projectname and "hello" as servletname got output like that:
      Your project has been successfully created. To see how it works type in "ant". Afterwards restart Apache httpd and Tomcat. Then type in "http://helloworld.HOSTNAME.DOMAIN"

    • run ant again

    • In Eclipse, refresh your project now.

    • Edit the file projects/servletconf/tomcat/webapps/admskel/WEB-INF/web.xml . Insert the pustefix.docroot parameter right at the end of the "servlet" node:
      <init-param> <param-name>pustefix.docroot</param-name> <param-value>/mnt/space/marcus/programming/workspace/helloworld/projects</param-value> </init-param>
      This is the example for my box. Of course, change the absolute path to your path !

    • Edit the file projects/helloworld/xml/frame.xml . Comment the "pfx:maincontent" line.
    • Insert a "Hello World !" just atop of that comment.

  4. Run the project
    • run ./startTomcat.sh
    • Now, we should be ready to launch the web browser. For my box and that example, the call is:
      http://helloworld.neh:8080/xml/hello

    • If the requested web page looks like this image, Pustefix is running.

      It's your happy day ! :-)


    • In the tomcat startup shell, you can stop tomcat by Control-C.