ContentsGetting Set UpA Simple Test Page
Previous: Installing on a Developer's PC | Next: Web Page Design

A Simple Test Page

If you looked at the source file of cmds.weld and/or modified the regsub command parameters, you may be discouraged because that page is:

Hey, that page is a "test pattern"... what else would you expect!  After you gain some experience, you may want to come back to cmds.weld and make some changes to it to make your own test page.

Now what we really SHOULD do to get started...

By this point, I have to assume that you are familiar enough with your set up to know where to put WELD and HTML files (the "web document directory") to make them visible to your web server so that you can view them with your web browser.  If not, write me and I'll do my best to help.

Create a new file with your preferred text editor, with these contents:

  <html>
  <head>
  <title>[set tvar "First Page"]</title>
  </head>
  <body>
  <center>
  <h1>$tvar</h1>
  </center>
  <h3>$tvar</h3>
  </body>
  </html>

Then save this page in the web document directory with the name "first.weld" (actually, the extension doesn't matter in this case, just be sure you use whatever name is saved), then view it with your web browser: http://localhost/servlet/weld/first.weld

Where ever the $tvar was used, the web browser should show "First Page".  If not, your weld servlet may not be properly installed.  This may not seem like much, but your little page actually called and used several Java classes to evaluate the "set" command and to perform the substitutions.  This is the essence of WELD.

A little more work now to use the counter ("[counter]") and the current time ("[now]") commands.  These commands are implemented by the Java classes CounterCmd and NowCmd, and use server-side resources such as a persistence and the server's hardware clock:

  <html>
  <head>
  <title>[set tvar "First Page"]</title>
  </head>
  <body>
  <center>
  <h1>$tvar</h1>
  You are visitor [counter] at [now]
  </center>
  <h3>$tvar</h3>
  </body>
  </html>

ContentsGetting Set UpA Simple Test Page
Previous: Installing on a Developer's PC | Next: Web Page Design

Modified: Tue Apr 18 08:53:09 EDT 2000