• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MVC Architecture

 
Mike London
Ranch Hand
Posts: 1185
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the Professional JSP book, chapter 6, where they discuss the MVC architecture, I don't see where they discuss how to actually build and use the components (other than a web page that shows all works)
I'm getting tons of errors trying to build even the controller.java piece.
Since there are multiple packages, some of my import statements, for example, don't seem to work correctly.
Anybody successfully implemented this chapter's stuff?
Is there a simpler introduction to some working MVC code I should/could look at first?
Thanks for anybody's input.
--Mike
 
Ronald Francis
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at struts at jakarta.apache.org ?
That may give you some ideas
I've implemented a full MVC app myself from scratch, but can't share the code (client's own it) ...
Will be glad to answer any specific questions about MVC though
 
Mike London
Ranch Hand
Posts: 1185
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. <s>
My basic problem is that I don't know where to put some of the files.
Here's my take for Tomcat. I have some "holes" in my knowledge though as I'll indicate below.
1. JSP files -- anywhere under ROOT. This part OK.
2. Compiled classes -- under WEB-INF\classes.
3.Where do config files go?
Among these ...
WEB.XML
Event.properties
URL.properties
I think I *almost* have the downloaded Wrox code set up right (and can then spend however much time is needed to actually understand it).
Chapter 6 in the Wrox Professional JSP is good, but forgets to explain how to actually set up, on Tomcat, all the good code that's there -- I'm talking mostly about these config files that aren't covered, that I can see, in the Tomcat setup discussed earlier in the book.
Look forward to your reply.
-- Mike
 
Roger Graff
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your config files typically go in the WEB-INF folder.
Check out Simon Brown's chapter "Designing Web Applications and Servlet Patterns" in the book "Professional Java Servlets 2.3". Download it here: http://www.simongbrown.com/

A great book for web app configuration is
"More Servlets and JavaServer Pages" by Marty Hall.
 
Ronald Francis
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well web.xml is easy , it goes under Web-inf
Unfortunately , the property files are trickier, depends on how the code is trying to access them.
Maybe a quick grep /find in files on the code will reveal whats happening.
 
Mike London
Ranch Hand
Posts: 1185
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all the great replies.
Yes, the More Servlets book is much more understandable for MVC.
However, regarding the placement of these config files from the PRofessional JSP, 2nd Edition,(like "Event.properties" and such), why isn't this documented in the book as to where they should go.
This chapter seems half finished. The code is good, the discussion is good, but the configuration of all the cool code (seems to be) left out.
Thanks again...
-- Mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic