This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Html POST & GET

 
ram ragu
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
We can do a GET or POST from a FORM but I want to open a new window and inside that I want to run my servlet ... and it
should be a POST
in the form we give like this
method="post" ACTION="http://localhost:8080/examples/servlet/GenerateReport"
but I have to do the following
myview=window.open("http://localhost:8080/examples/servlet/GenerateReport");
view.focus();
how to make the request as a POST when we open a new window?
anyidea how to do this
your help is highly appreciated!
Ram
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you just want to open a new instance of the browser and not control what window decorations it has (via the 3rd parameter of window.open()) you may be able to achieve what you need by not using window.open() at all and by placing the following attribute on your <form> tag:

If that doesn't give you the amount of control that you need, please respond and maybe we can come up with something a bit more complex, but that could achieve your goal.
hth,
bear
[ May 03, 2002: Message edited by: Bear Bibeault ]
 
ram ragu
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry! I can not use the TARGET
Reason is I want to control the new popup window and the toolbar .. at the same time I will not be submitting the form ... instead I will use the OnClick function of the button which is available in the FORM
submitRequest function will open a window and pass the url
Kindly let me know !
 
Charlie Sturman
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.create the window:
submitWindow = window.open(... blank )
2.create the form in the new window using document.write:
submitWindow.document.write("html with the form tag ,atributes like method=post,action=servlethtml and form field
tags and the values you want to send.
submitWindow.document.close()
3.create a submit event:
submitWindow.document.form.submit()
btw:
If you were using get you could just append the fields to the uri.I assume you knew that
Here is an example similiar to what I am suggesting taken from an app I wrote:

[ May 04, 2002: Message edited by: Charlie Sturman ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic