File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Cattle Drive and the fly likes Re: Assignment Servlets-4a Videos Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Re: Assignment Servlets-4a Videos" Watch "Re: Assignment Servlets-4a Videos" New topic

Re: Assignment Servlets-4a Videos

Kelly Loyd

Joined: Oct 10, 2005
Posts: 28
Hi all,

"Write a web application that allows you to add new movies to an ArrayList and lists all the movies."

I don't think I can do that in 15 lines of JSP.

I'm not quite certain if I understand the requirement for this assignment. Should I only have a 'bare bones' listvideos.jsp or should I try to read the ArrayList (which will contain VideoData objects) and display the contents?

Or do I just display the empty table and provide a button to 'add' a video?

I think I may have overdone this one ;-)

Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
Everything is not in 15 lines of jsp. You have the VideoServlet (which you write)and the addvideo.jsp, the index.html, and the PathFinder class (which are provided) to go with the web app.

You start by displaying an empty table. Using a link, go to addvideo.jsp to add a video. The logic is in the VideoServlet. The JSPs are only for displaying the results. You should have no logic in your JSPs, no if/elses or loops or stuff like that. Keep it simple.
[ October 19, 2005: Message edited by: Marilyn de Queiroz ]

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Kelly Loyd

Joined: Oct 10, 2005
Posts: 28
Thanks Marilyn!

That was my problem, I tried to put the logic into the JSP, not the servlet. Duh. I got it working, neat-o.

I'll come back to this after I get through all the other Assignments in the proper fashion.

I agree. Here's the link:
subject: Re: Assignment Servlets-4a Videos
jQuery in Action, 3rd edition