WEB4J Developer Tools

When someone says, "This is really tricky code," I hear them say, "This is really bad code."
- Steve McConnell
The WEB4J Developer Tools application helps you build WEB4J apps. It is meant strictly for the developer. Using it in a production environment is highly discouraged, since it performs operations which would pose a grave security risk.

These tools do not use a database. Rather, they store data in session scope, and use a number of settings in web.xml. The source code is provided, under a BSD open source license. You may alter the implementation to more closely suit your needs.

Download Now


Log Viewer

View and query log files in your browser.

The Log Viewer is very useful for debugging. It automatically accesses the most recent log file in a directory, so it always has the most recent logging information. Repeatedly vewing the most recent entries is as simple as a browser refresh.

Features:

The assumed format of logs is that of default JDK loggers. If you have not altered the output format of JDK logging (which is usually the case), then you may use it immediately. If your log files are in a different format, then you will need to provide an implementation of LogParser. (This is not a difficult task, and you may use existing code as a guide.)

Viewing the parsed records is both more pleasing to the eye, and more flexible, since multiple criteria can be entered in a query.

Log files can always be viewed in a raw, unparsed form as well, when needed. Since the raw style does not require any parsing of log records, it is always available.

Source Code Stats

High level stats and metrics for your code.

Features:

Code Generator

Save typing effort with a code generator.

Although WEB4J does a good job of removing repeated code from your application, there are still items which are somewhat repetitive:

This is a passive code generator: once the code is generated, you may edit it as you wish.

This tool generates 5 items: JSP fragment, Action, Model, DAO, and .sql file. It is particularly suited for generating features needing ActionTemplateListAndEdit and ActionTemplateShowAndApply.

Items are generated and displayed in plain text. In addition, settings in web.xml allow saving the generated items directly to your file system as a side-effect.

Getting Started With WEB4J Developer Tools

Before getting started, please review the README file inside web4j-tools.zip. Note that you must supply two jars:

There are two ways to use the WEB4J Developer Tools:

Here's an example of the first style, running web4jtools.war as a regular web application under Tomcat 5:

  1. Place the web4jtools.war file in [TOMCAT_HOME]\webapps\.
  2. Start Tomcat. This will simply cause Tomcat to explode the .war file.
  3. Edit [TOMCAT_HOME]\webapps\web4jtools\WEB-INF\web.xml to suit your environment.
  4. Restart the app to pull in your edits to web.xml.
  5. Navigate to http://localhost:8080/web4jtools/. (If your Tomcat port is not 8080, then amend as needed.) If you encounter a problem, review the server logs under [TOMCAT_HOME]\logs\, and check your edits to web.xml.
  6. Click on the 'Help' menu item to list hints and advice at the top of each page.

Here's an example of the second style of installation. It installs to C:\projects\web4jtools\, and uses Tomcat 5.

1. Unzip web4j-tools.zip to C:\projects\web4jtools\. The file structure will look like:

C:\projects\web4jtools\
  codegenerator\
  images\
  logview\
  metrics\
  WEB-INF\
  webmaster\
  build.xml
  Error.jsp
  ...

2. Make an entry in Tomcat's [TOMCAT_HOME]\conf\server.xml file, to map the path '/web4jtools' to the source directory:

<Context 
  path="/web4jtools" 
  docBase="C:\projects\web4jtools" 
  reloadable="true" 
>
</Context>

3. Configure C:\projects\web4jtools\WEB-INF\web.xml to suit your environment.

4. Start Tomcat and navigate to (assuming the Tomcat port is 8080):

http://localhost:8080/web4jtools/
If you encounter a problem, review the server logs under [TOMCAT_HOME]\logs\, and check your edits to web.xml.

5. Click on the 'Help' menu item to list hints and advice at the top of each page.