File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sepration of Data from Presesntation layer

 
Jawahar Rajan
Ranch Hand
Posts: 38
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic