This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes how to submit a request to a url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to submit a request to a url" Watch "how to submit a request to a url" New topic
Author

how to submit a request to a url

subodh gupta
Ranch Hand

Joined: Jul 23, 2007
Posts: 203
Hi Ranchers,

I am trying to submit my page to a url formed in a javascript can you please guide me how to do it.

the problem i am facing is the page gets submitted to the action mentioned in form tag.

if i remove it than it doesn't go anywhere.


http://subodh-gupta.blogspot.com
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

First, we need to figure out exactly what you want to do.

You don't submit a page.
You submit a form.
When you submit a form the request goes to the URL in the form's action attribute. If you don't explicitly provide an action attribute, the default (which is the URL of the current page) is used.

What is it, exactly, that you're trying to do?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Prasad Tamirisa
Ranch Hand

Joined: Mar 26, 2007
Posts: 130
I am trying to submit my page to a url formed in a javascript can you please guide me how to do it.


I presume that you are trying to submit the form with out explicitly mentioning the action attribute....

If that is so, you can set the action attribute anywhere before your form closure tag (</form> like below.



Regards,
Durga Prasad
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61064
    
  66

Originally posted by Prasad Tamirisa:

If that is so, you can set the action attribute anywhere before your form closure tag (</form>

No, that is not necessary.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Prasad Tamirisa
Ranch Hand

Joined: Mar 26, 2007
Posts: 130
No, that is not necessary.

Agreed. . The following holds good in that case.
When you submit a form the request goes to the URL in the form's action attribute. If you don't explicitly provide an action attribute, the default (which is the URL of the current page) is used.

[ May 17, 2008: Message edited by: Prasad Tamirisa ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to submit a request to a url