wood burning stoves 2.0*
The moose likes Servlets and the fly likes Using a servlet to dispatch pages and redirect to other servlets. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Using a servlet to dispatch pages and redirect to other servlets." Watch "Using a servlet to dispatch pages and redirect to other servlets." New topic
Author

Using a servlet to dispatch pages and redirect to other servlets.

William Wild
Greenhorn

Joined: Dec 10, 2002
Posts: 23
Hi All,
This is more of a design issue, but I haven't a clue if it could be coded.
I am trying to develop a system where all requests are handled solely by servlets. These servlets will not generate any html output themselfs, but get the necessary information from xslt stylesheets with there content described by XML input from file or database output (Still in xml form).
There will be a controlling servlet that will handle the initial doGet, and server up a front page based on an xml file and stylesheet. Every request from this initial page will then handled by the servlets doPost. This will again server up a page if there is no database access required, or hand over control to another servlet that will do a similar task, but get it's xml data from a database.
My questions are thus:
1) Is this a practical approach to handling the site layout and data presentation? Or will this approach lead to major complications if something goes wrong with the connection?
2) Is this going to make it harder to track the users data if they are not able to use cookies? Say for example, if their data was in hidden form fields or using url rewriting.
3) Could it actually be coded, so that the servlets could run without having to know about the content of any of the stylesheets or xml output?
I know it's not a specific java question, but it will have to be coded in it. So if anyone could tell me if this could work, or if there is a better approach, I'd be most greatful.
Cheers
Bill


--<p>Bill<p>"Make it idiot proof,<br /> and someone will make a better idiot" -- ANON
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12789
    
    5
This sounds like the approach taken by the open source Cocoon project (xml.apache.org) and by several commercial products. Data in XML form manipulated by XSLT and all coordinated by a servlet. Cocoon may be more complex than you need but you could get inspiration from the code.
Bill
Mr. C Lamont Gilbert
Ranch Hand

Joined: Oct 05, 2001
Posts: 1170

How would this affect saving shortcuts to your pages?
William Wild
Greenhorn

Joined: Dec 10, 2002
Posts: 23
CL,
It shouldn't affect it in any bad way. The servlets would be sending to a frame in a site main page. All the data displayed is scientific data that will change every second, so bookmarking anything but the index would be pointless.
Cheers
Bill
William Wild
Greenhorn

Joined: Dec 10, 2002
Posts: 23
Bill,
Thanks for the tip. Just downloaded the src. And you were not wrong, WAY over the top of my head So far I can't even fathom 1% of it.
Expect loads of questions quite soon
Cheers
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using a servlet to dispatch pages and redirect to other servlets.