File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 60046
    
  65

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
 
Similar Threads
Automate POST in URLConnection
Struts Forms ( html:form )
Hidding parameters
calling Action class from jsp frame
Calling an external url...and geting the response