• Post Reply Bookmark Topic Watch Topic
  • New Topic

basic html ->JSP-> javabean-> database questions

 
Armand Deluvak
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am somewhat unsure of what syntax and/or methods to use when passing fields from an html form page to a database (such as MSAcess) when using a .jsp file as a controller which calls the needed methods in a javabean.
Specifically, my html form has several textfields of information to be filled out by the user, and it has several input buttons to determine what actions are to be performed on that data entered into the textfields. If I declare that method=post and that action=foo.jsp, am I right to believe that in that foo.jsp file I can use, say, some if(name=buttonA){a.foobean}; else if(name-buttonB){b.foobean}; etc. logic that will call the appropriate methods in the bean?
Also, if in the foo.jsp file I use the
<jsp:setProperty name="entity" property="*"/>
that that will automatically set ALL of those field properities in the foobean -- given that the bean has the appropriate setter and getter methods?
This brings me up to my real confusion which is do I need to use a doPost(request, response) method anywhere in dealing with properties going between the html page and the bean, or is the doPost method only for use in dealing with the jdbc from the bean, or am I totally clueless in this matter?
Thank you,
Armand
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Armand... hhmmm it looks that you got a bunch of questions hey ??
Ok, why don't you check this url:
http://www.javaworld.com/javaworld/jw-03-2000/jw-0331-ssj-forms.html
read it thoroughly and also check this:
http://www.mycgiserver.com/~aegcp/test/form.jsp
I hope this will answer most of your questions. I can send you the entire source code so you can have a look at it. Drop me an e-mail if you want
and yes,
<jsp:setProperty name="entity" property="*"/>
it sets all the field properties, as long as the names are all the SAME, and you implement getter and setter methods.
cheers
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!