aspose file tools*
The moose likes Cattle Drive and the fly likes Question about MVC2 BeeServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Question about MVC2 BeeServlet" Watch "Question about MVC2 BeeServlet" New topic
Author

Question about MVC2 BeeServlet

juliane gross
Ranch Hand

Joined: May 30, 2002
Posts: 161
In the 2nd example code of BeeServlet we have in method init():


I do not quite understand what the first parameter ("default") is doing exactly.
In the API I read:
actionKey - The text that will be sent in the servlet parameter to kick off this action.


I think that init() starts class Default which then runs it's doAction() method. But what could class Default then do with param "default"?
Or would servletData be able to do something with it? And if yes, what??




Thank you for any enlightening hints!
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
The parameter is passed when the jsp calls the servlet. If no parameter is specified, "default" is called.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Richard J Barton
Greenhorn

Joined: Feb 07, 2012
Posts: 6

I posted a similar question. what parameter is set in the jsp?
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2853
    
  11

The parameter is "action", so something like http://<myurl>/BeeServlet?action=default is what you need. There's nothing significant about "default" though. The framework just assumes the first action handler added is the default one, and uses that one if it can't find an "action" parameter in the request.
Richard J Barton
Greenhorn

Joined: Feb 07, 2012
Posts: 6

thanks. I got it now.
In a link action=desiredAction
In a form a button with a name of action and a value of desiredAction.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about MVC2 BeeServlet