| 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: 56233
|
|
|
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.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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.
|
 |
 |
|
|
subject: The Proper use of ActionServlet
|
|
|