This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The Proper use of ActionServlet

 
Richard J Barton
Greenhorn
Posts: 6
Firefox Browser Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Richard J Barton
Greenhorn
Posts: 6
Firefox Browser Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My bad.
ActionServlet is in com.javaranch.common and I was told to use this for lesson 4 of servlets.
 
Richard J Barton
Greenhorn
Posts: 6
Firefox Browser Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is located here:
http://www.javaranch.com/common.jsp
 
Richard J Barton
Greenhorn
Posts: 6
Firefox Browser Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic