aspose file tools*
The moose likes Cattle Drive and the fly likes Progress, I think! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Progress, I think!" Watch "Progress, I think!" New topic
Author

Progress, I think!

Carol Murphy
village idiot
Bartender

Joined: Mar 15, 2001
Posts: 1197
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

Joined: Jul 22, 2000
Posts: 9052
    
  12
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.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Carol Murphy
village idiot
Bartender

Joined: Mar 15, 2001
Posts: 1197
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

Joined: Jul 22, 2000
Posts: 9052
    
  12
Each class should implement the same abstract method that the Default class implements.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Progress, I think!