Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Progress, I think!

 
Carol Murphy
village idiot
Bartender
Posts: 1202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After hours of fussing with VideoServlet, I came to the conclusion that the method with the list stuff in it was never actually being called. So I commented out the add stuff, and voila, the link from the index page now retreives the list jsp. However, the code still isn't working. I'm having trouble coming up with a way to tell the app which action I want it to perform. It seems to do the one that appears first, even if I put it inside an if block. It seems to me the logic should work, but it doesn't. I tried doing a private class like default for each action, but the compiler complained because there are some abstract classes I would have to implement in order to do that, and I have a feeling that this is the wrong trail. The doc for ActionServlet states:
/**
* Override init and call this method for every action to be implemented.
*
* @param actionKey The text that will be sent in the servlet parameter to kick off this action.
*/
I want to put all of the code inside the inner class Default that deals with adding or listing and where to forward, etc, and then have init add the actionHandler, just like was done in reverse and bee servlets. Is this the right approach, or am I missing something because there are two actions to be dealt with here?
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you want an inner class for each action. Default can list the videos (at least for now), the other one will add a video. Each action is listed in init with it's associated class.
 
Carol Murphy
village idiot
Bartender
Posts: 1202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I have to implement the abstract methods mentioned by my compiler in order to do that, or can I put the inner class inside Default? Hmmmm... Wish I was at home right now!
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Each class should implement the same abstract method that the Default class implements.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic