[thelist] Java, XML and JSP.

David Appleton david.appleton at barnardos.org.uk
Thu Oct 17 04:24:01 CDT 2002

[ Picked text/plain from multipart/alternative ]
Thanks for that link Dave, I'll get that up and running soon and see how well it works under pressure.

I've been thinking about this idea for a while now, and as we're redeveloping the entire site right now, it's been a good chance to test some things out.  I'm sure that someone somewhere must have thought of this already, but I can't find any info on it.

In order to do this I've found that managing the site has had to be treated completely differently from our traditional past.  Each individual section can now be self contained with little or no interaction with other sections of the site.  Once a section is made and placed in to the file structure, it is integrated to the site with XML.  If you want to get rid of a section, simply delete it from the file structure and adjust the XML accordingly.  Integration of all sections is managed by XML and not hand coded.  We're using DreamWeaver for templates and with this I have managed to cut the number of primary templates from 8 down to 2.  So in theory, a complete restructure should now take a fraction of the time of what it has done up until now.

Anyway, down to the point...

The important part of the XML file looks something like this:

<siteStructure name="Home" location="/">
  <sl1 name="" shortName="" location="" baseHexColour="">
    <sl2 name="" shortName="" location="" />
    <sl2 name="" shortName="" location="">
      <sl3 name="" shortName="" location="" />
      <sl3 name="" shortName="" location="" />

  <sl1 name="" shortName="" location="" baseHexColour="">


* The attribute 'name' refers to the name of the section which will be viewed by the user.
* The attribute 'shortName' is a shortened version of the 'name' used on a page where maybe space is at a premium - navigation for instance.
* The attribute 'location' refers to the location of a section from the site root.  ie "/directoryA/directoryB/" I have assumed that every directory should contain an index.jsp, so the file is not referenced here.
* The attribute 'baseHexColour' is one of our little individualities - each primary section is colour coded, so this contains a Hex colour reference - Although I'm thinking of changing this as this should really be down to the stylesheet.

Obviously this could be adapted to deal with the needs of other designs and structures without much in the way of problems.

So with that XML file in place, when each JSP page is loaded, the location of the file is found from the URL and passed to a JavaBean.  Within the JavaBean this location is compared to those locations within the XML and a number of 2D arrays are passed back to the JSP page with all the navigational information it needs for that particular section - The logic within the SAX parsing was a bit of a brain teaser, but works fine now.

>From now on, if you need to change the site structure, no need to touch the HTML, just adjust the XML.

So hopefully that explains the idea.  I'm sure that there are probably holes in it, but I've got it working and it's looking good.

I'd be interested to see what you think as well, as this is one of my first real adventures with XML.


>>> David.Cantrell at Gunter.AF.mil 16 October 2002 14:27:13 >>>
>Has anyone ever done anything like this before, or have any good advice for
me here?  Also, does anyone know of any good
>(free) load testing software I could use in this case?

Hey from another Dave! :)

I haven't done this, but it sounds very interesting. So much so in fact that
I'd love to see what you are doing, maybe I could do something similar. We
have a 3-tier navigation system, global nav + subsite nav + local nav, and
this may simplify things a great deal. Could you send me examples of the XML
file you are using for this?

For load testing Microsoft has a neat little tool called WAST, Web
Application Stress Tool. It's scriptable to different scenarios and can
really punish your server. I haven't used it in a while, but think I'll take
this opportunity to go ahead and download it again...


For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !


Important Notice
This communication contains information, which is confidential.
It is intended solely for the use of the intended recipient/s.
If you are not the intended recipient/s please note that any distribution,
copying or use of this communication or the information in it is strictly
prohibited.  If you receive this communication in error please notify
postmaster at barnardos.org.uk and then delete this e-mail and any copies of it.
Please note that this communication and any communication received by or on
behalf of Barnardo's or from or on behalf of anyone else from this e-mail
address may be monitored by our e-mail or other monitoring software, or
inspected by us.  This communication is from Barnardo's, a company limited
by guarantee, registered office: Tanners Lane, Barkingside, Ilford, Essex,
IG6 1QG, reg. no. 61625 England, charity reg. no. 216250.

To find out more about Barnardo's or to make a donation visit our web site
at http://www.barnardos.org.uk.

More information about the thelist mailing list