permaculture playing cards*
The moose likes HTML, CSS and JavaScript and the fly likes Default action in form tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Default action in form tag" Watch "Default action in form tag" New topic
Author

Default action in form tag

pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 316

Hi,

What is the default action if no action is specified in the form tag.
e.g. default method is GET if no method is specified.


Thanks,
Pramod
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

There really isn't one. But since the action is page-relative, an empty action results in submission to the URL of the page.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 316

So, if a page is submitted, can I map it's url pattern to a servlet ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Not sure what you are asking. The action can be a URL that maps to a servlet.
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 316

My question is that we specify the action name in the form tag along with method.
This action is mapped in the url pattern tag of servlet and accordingly it invokes the particular servlet class.

So, if I don't specify an action and as there is nothing default as such, then can we write something like <url-pattern>*</ur-pattern> in the <servlet> tag to carry out further processing.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Default action in form tag
 
Similar Threads
return to wrong page
doGet() and doPost()!!!
form bean scope
Using SSL on HttpURLConnection
execute() issue in Action class