template is a file that holds the html skeleton and could along with the
relevant JavaScript provide desired functionality
foe e.g. after a user logs in, you want to provide him a customized page
with his name, date etc
one way to accomplish this would be to hardcode the entire html in the Java
code and there have a string that represents the name
like out.println("Welcome"+name); where name would hold the actual
value.
another option could be having a file that has in place of ("Welcome"+name)
just "Welcome"+document.write(urname) where var urname is declared in the
beginning from the output served to the browser like
out.println("<script>var urname=\""+name+"\"</script>");
so the static part would be the file and the dynamic part would be the
JavaScript that the servlet generates.
another option could be to do parsing based on custom tags and replacing
them with relevant data from the servlet
-----Original Message-----
From: Avidan Ross [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 14, 1999 1:21 PM
To: [EMAIL PROTECTED]
Subject: Re: writing codes using servlets
How would the templates be stored and how exactly would this be implemented?
Thanks,
Avidan
----- Original Message -----
From: R. Mathur <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 14, 1999 3:14 AM
Subject: Re: writing codes using servlets
> one way could be html templates. where most of the static part is read
(from
> the template)and only the dynamic content is generated by the servlet
>
>
>
> when we embed html in doget() or doPost()
> we say
> printwriter pw = PrintWriter pw= res.getWriter();
> pw.println("<html>");
> pw.println("<head>");
> pw.println("<table ..>");
> pw.println("<tr>");
> pw.println("<tr>");
> ..........
> ..
> pw.println("<\html>");
> the code is clumsy .
> i will not prefer to use
> pw.println("<html><head> <title> Hello word application
> ,/title></head><body><table cellpadding=3 cellspacing=5 border=2
> bgcolor=blue><tr>...............
> .................. </html>");
> this is difficult to manage .
>
> is there any simple way to embed html in servlets ?
>
> when we use oracle wed server with plsql cartriges we say
> htp.print('
> <html>
> <head>
> <title>
> Hello world
> <\title>
> ....
> ...
> </html> ');
> this eases the maintainability .
> such a thing is not possible when we use pw.println() method.
> i just want to whether there is an simple way to code .
>
> Thanks.
>
>
___________________________________________________________________________
> 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
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
___________________________________________________________________________
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