> It depends on how you find the gaps in the HTML and how many gaps
> there are.
>

The application consists of approx. 10-20 pages which all have a number of
fields which are dynamic. The fields consist of standard text fields, input
fields and poplists. With the io-solution we stream the files looking for
special marks we put in there. When a mark is encountered we print the
strings we want there.

> Why do you have to clone the XML structure?
>

The reason we used the xml/clone solution is we wanted to reduce file-IO:
for every request a template file was read from the filesystem and returned
to the user.
By using cloning the xml-file is read only once (at init time) and then
cloned for as many times as requests come in (and garbage collected when
ready). We used xml here, because setting the values is much easier this way
compared to the streaming solution (we find the node with a
'treewalker'-object and add the nodes/attributes/values we want).

> It seems to me that the best way to do is read in the XML structure
> and then parse through the XML structure sending output to a stream.
> That's not cloning. It would be quite quick.
>

I'm afraid not: we still have the file-io when parsing the xml.

>
> - Are there better methods for doing this? (for now we cannot
> >use jsp's and i do not want to wrap the html in strings)
>
> JSP is the ideal structure because it is compiled.
>
Yeah, i know, but unfortunally this is not an option (using OAS408) :-(

>
> Nic Ferrier
>

> -----Original Message-----
> From: Nic Ferrier [mailto:[EMAIL PROTECTED]]
> Sent: donderdag 20 juli 2000 2:49
> To: [EMAIL PROTECTED]
> Subject: Re: Cloning or File-IO in my servlet?
>
>
> >>> Joost Verhagen <[EMAIL PROTECTED]> 20-Jul-00 1:23:42 PM >>>
>
> >1: using 'template'-html files which are read by the
> >servlet, streamed (filling in the 'gaps') and returned,
> >when a request arrives (in the doget/post).
> >2: using xml, by parsing the html into an XML object
> >at servlet-init time (init()) and cloning that xml-object
> >when a request arrives (doget/post), setting the different
> >nodes and printing the xml/html-tree to the output.
>
> >My questions are the following:
> >- What is more 'costly'?: cloning an object or streaming a
> >file (I/O), especially in a high-hits envirionment.
>
> ______________________________________________________________
> _____________
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to