aspose file tools*
The moose likes JSP and the fly likes Sepration of Data from Presesntation layer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Sepration of Data from Presesntation layer" Watch "Sepration of Data from Presesntation layer" New topic
Author

Sepration of Data from Presesntation layer

Jawahar Rajan
Ranch Hand

Joined: Feb 28, 2002
Posts: 38
Andrew,
I am trying to follow up on the thread about sending Data to a JSP.
You suggested that the best way was to keep the data in a servlet. thus getting a sepration of data from the presentation layer.
If get my data to Servlet what are some options available to parse it to the JSP for display in a web page. Do I use an XML parser and ask the JSP to read the XML file or should I convert the XML file into a web page?
Any suggetsions or ideas are welcome.
Thanks
Jawahar
Andrew Patzer
Author
Ranch Hand

Joined: Jul 11, 2002
Posts: 30
Originally posted by Jawahar Rajan:
Andrew,
I am trying to follow up on the thread about sending Data to a JSP.
You suggested that the best way was to keep the data in a servlet. thus getting a sepration of data from the presentation layer.
If get my data to Servlet what are some options available to parse it to the JSP for display in a web page. Do I use an XML parser and ask the JSP to read the XML file or should I convert the XML file into a web page?
Any suggetsions or ideas are welcome.
Thanks
Jawahar


What I was suggesting was that you use a controller servlet to delegate your business logic to a separate action class. Your action class would then store the data inside of a JavaBean. The controller servlet would add the JavaBean to the request attributes and forward the user to the JSP page. The JSP page would then access the data using the JavaBean's get() methods.
Andrew


Andrew Patzer<br /> <br />Author of: <br /> <br /><a href="http://www.amazon.com/exec/obidos/ASIN/1590590201/ref=ase_electricporkchop/103-9402848-9855031" target="_blank" rel="nofollow">JSP Examples and Best Practices</a><br /> <br /><a href="http://www.amazon.com/exec/obidos/tg/detail/-/1590594118/qid=1109107718/sr=1-7/ref=sr_1_7/104-5148852-3564711?v=glance&s=books" target="_blank" rel="nofollow">Foundations of JSP Design Patterns</a>
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
See my article on Struts:
http://www.javaranch.com/newsletter/Mar2002/newslettermar2002.jsp#struts
Although I am specifically talking about the Struts architecture in the article, you don't need Struts to implement an MVC architecture.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
 
subject: Sepration of Data from Presesntation layer