codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Post&submit text to a form in java  long_john321 at 20:18 on Friday, August 26, 2005
 

Hello all,

I am a Java developer and am wondering how do I use a java program to post to form and fill in some text on webpages?
example: do a program that posts a message to:

http://long_john321.t35.com

thats a site done by me to test this.

I would be thankful if anyone would tell me how to do this or give a hint to a program w/ source, howto, tutorial or book.
Thanks!

  Re: Post&submit text to a form in java  kanad at 07:43 on Tuesday, August 30, 2005
 

You can do this using Servlet or JSP
Servlet
http://java.sun.com/products/servlet/index.jsp
you may need server for this
http://jakarta.apache.org/tomcat/
Tutorials
http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
www.jsptut.com/Index.html
http://www.caucho.com/resin-3.0/jsp/tutorial/index.xtp
http://www.freeprogrammingresources.com/jsp.html
Search on Google
http://www.google.co.in/search?hl=en&q=JSP+Tutorial&meta=

  Re: Post&submit text to a form in java  long_john321 at 20:52 on Wednesday, August 31, 2005
 

Thanks for the answer, but it wasnt what I asked :(
I dont wanna use JSP on the serverside. I wanna do this with PHP, or asp on the serverside and regardless if I have the servers sourcecode or not. (so it works on the site I made for this example). The thing is I want it to work almost as a browser but no clicking!

  Re: Post&submit text to a form in java  javabits at 00:23 on Friday, September 02, 2005
 

Ummm OK if I understand you correctly then you basically want to simulate a browser, i.e. automate a form submission.

There are different ways to do this.

In java you might consider looking at HTTPUnit. Probably a bit too complicated if you ask me, overkill for whatever you need.

For perl you can use LWP although I think that WWW::Mechanize is a little more friendly. One thing I did notice with Mechanize is you do need to turn the cache off if you happen to be going to large or many pages.

PHP uses curl to provide you with the http protocol. Should be able to use that to do GET and PUT. This fellow here also wrote a http class that can do screen scraping, his examples seem to be GETs with the parameters passed in the url but should be simple enough to mod for PUT. Here's the url http://www.troywolf.com/articles/php/class_http/

semper fi...









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Why Use Method?
•  Re: Help with filesystem object & displaying in a table
•  Re: Genetic Algorithm Help
•  Re: How to make an investment calculator
•  Re: line breaks in GUI
•  Re: Graph in Gui...
•  Graph in Gui...
•  Re: Counting zero values in a string
•  Re: Help!


Recent Articles
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net
Creating CSS Buttons


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005