aspose file tools*
The moose likes Other Application Frameworks and the fly likes The Proper use of ActionServlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "The Proper use of ActionServlet" Watch "The Proper use of ActionServlet" New topic
Author

The Proper use of ActionServlet

Richard J Barton
Greenhorn

Joined: Feb 07, 2012
Posts: 6

Hi guys,
I am somewhat confused by the javadoc for ActionServlet. It says this about the addActionHandler method:
addActionHandler

public void addActionHandler(java.lang.String actionKey,
ActionServlet.ActionHandler actionHandler)

Override init and call this method for every action to be implemented.

Parameters:
actionKey - The text that will be sent in the servlet parameter to kick off this action.

What exactly is the actionKey and how do I present it to the servlet?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

ActionServlet is not a class in the Servlets Specification. If you are using a framework, then it might be a good idea to let us know which one.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Richard J Barton
Greenhorn

Joined: Feb 07, 2012
Posts: 6

My bad.
ActionServlet is in com.javaranch.common and I was told to use this for lesson 4 of servlets.
Richard J Barton
Greenhorn

Joined: Feb 07, 2012
Posts: 6

This is located here:
http://www.javaranch.com/common.jsp
Richard J Barton
Greenhorn

Joined: Feb 07, 2012
Posts: 6

OK. I get it now. To call a specific action, you would append to a link something like ?action=desiredAction.

In a form you would put a button with a name of action and a value of the desired action/

thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The Proper use of ActionServlet