Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java MVC Web Application  RSS feed

 
Pete Yanchek
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need help understanding how to create a Java MVC web application for this assignment...

Create an Object-Oriented To-Do List manager. Your program must allow users to:
1. Create lists of tasks
2. Add to and remove tasks from task lists
3. Mark tasks as done
4. Save lists to a data store
5. Load lists from a data store
6. Display all available task lists and select a given list to modify
 
Stephan van Hulst
Saloon Keeper
Posts: 6979
110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, first of all you need to be able to display a simple web page. Have you worked with an MVC framework before? I think Spring is the best known one, but from personal experience I can also really recommend Jersey.
 
Tim Moores
Saloon Keeper
Posts: 3511
77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you allowed to use a 3rd party framework for this? Or are you merely supposed to use the MVC pattern? It sounds like an assignments where you're supposed to write all the code.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps this article could give you an understanding of the patterns involved.
 
Pete Yanchek
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are just supposed to use the MVC pattern, I believe. I saw no mention of 3rd party frameworks.
The teacher posted this link https://docs.oracle.com/javase/tutorial/jaxp/, a PowerPoint on Java MVC Web App Design, and some additional slides on Servlets.
Frankly, I'm not sure what to do with it. I had an easy time understanding how to work with a Derby database, but now I am very lost. I missed the last few classes, but this project is due next week, regardless.
 
Pete Yanchek
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone please walk me through how everything is interrelated? I don't mean to seem so out of it, but I really did miss some time and I managed to get lost.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This diagram from the article I linked to describes MVC at its simplest:



A request is sent to a servlet which serves as the controller (the C in MVC).

This interacts with the Model (the M in MVC) which fetches information from the DB and puts it into appropriate classes (usually beans) for passing back to the controller.

The bean(s) are sent to a JSP view (the V in MVC) as scoped variables via a forward, and the generated HTML page is sent as the response.

Further refinements are needed for industrial-stregth apps (separation of task and page controllers, additions of front controller and so on), but the above is a good starting point for MVC web apps.
 
Pete Yanchek
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I will learn that diagram! The annoying part is that we never did anything with the web previous to this assignment.
It is literally me trying to figure out how to use web pages with Java all by myself.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah.... that seems pretty poor. There are a lot (and I mean a lot) of new concepts involved. Personally, I would be introducing them gradually and in order. But I haven't taught in over 20 years.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!