Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieve the Form action name

 
Betsy Camel
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to retrieve the form action name in the servlet.

eg
<form name=form1 action="hello">
</form>


is it possible to retrieve the action name (hello) in the servlet
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the action is the address of the resource to which the browser will post, you can retrieve it with request.getRequestURL or request.getRequestURI.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic