Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet submit button

Have Programming Question? Ask it here!
 
 
 


gautamshetkar
submit button
1 Answer(s)      3 years and 5 months ago
Posted in : JSP-Servlet


<p>hi
I am trying to insert record in database using hibernate in JSP(Netbeans). When I click insert button it should go to insert.java class but fails to go.</p>

<ul>
<li><p>index.jsp
&lt;%</p>

<pre class="prettyprint">String uname="";
String pass="";
Object action;
</code></pre>

<p>%></p></li>
</ul>

<p><html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Admin Login Form</title>
    </head>
    <body>
        <form method="post" action="Insert.doPost">
        Enter Username<input type="text" name="uname" value="" /><br>
        Enter Password<input type="password" name="passwd" value="" /><br>
        <input type="submit" value="Insert" name="login" />
        </form>
    </body>
</html></p>

<p>insert.java</p>

<p>public class Insert {</p>

<pre class="prettyprint">protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    // TODO Auto-generated method stub
    String c1 = request.getParameter("uname");
    String c2 = request.getParameter("pass");
            //String action = request.getParameter("insert");
            ConnectDatabase db = new ConnectDatabase();
    db.setInfo(c1,c2);
</code></pre>

<p>}
}</p>

<p>Plz help me</p>

Advertisement
View Answers

February 18, 2011 at 5:47 PM


Perform action on Servlet from jsp in the following manner:

Put your servlet inside classes folder of your web application folder inside appache tomcat.

Check out the jsp servlet Directory Structure



Related Tutorials/Questions & Answers:
submit button
submit button  <p>hi I am trying to insert record in database using hibernate in JSP(Netbeans). When I click insert button it should go...; <input type="submit" value="Insert" name="login" /> <
JSP Submit Button
JSP Submit Button  Sir, I have a JSP page with 2 Submit button, both calls doPost method of same servlet. If I click any submit button the text box value get refreshed and set to null or blank, that should not happen. Plz help
Advertisements
image on submit button
image on submit button  i need to set an image on submit button. In javascript we can create a button like.. <a href="javascript:;" class="button...: transparent; cursor: pointer; or input[type=submit] { background: transparent
Submit button to MySQL database?
Submit button to MySQL database?  Need help linking html code...="text" name="Level" /> </form> <td><input type="submit" name="Submit" value="Submit"></td> </body> </html> <
Submit button to MySQL database?
Submit button to MySQL database?  Need help linking html code...="text" name="Level" /> </form> <td><input type="submit" name="Submit" value="Submit"></td> </body> </html> <
Disabling submit button using jQuery
Disabling submit button using jQuery  Hello Sir I want to know - is there any way or approach to disable client side form's "Submit" button. Please give code also.   For all submit buttons, via JQuery, it'd
How can we submit a form without a submit button?
How can we submit a form without a submit button?  How can we submit a form without a submit button
Struts application two submit button
;/html> Here am using two submit button one is login and another one is new...Struts application two submit button  Hai, i'm new in struts...;html:submit tabindex="6" styleClass="btTxt"> <bean
On Click on Submit Button Display Data on Orderlist
On Click on Submit Button Display Data on Orderlist  How can retreive data from database on orderlist on Click on submit Button of same page
Click On Images of Submit Button Perform Action
Click On Images of Submit Button Perform Action  I have login page in which insert of submit button i used image. Therefor on Click of image i have to validate form , link with database and goto the next page
How to save form fields into the MySql Database without submit button in jsp?
How to save form fields into the MySql Database without submit button in jsp?  I want to store user inputs into the database using javasccript or ajax or jqury but without submit button. Form Contains three fields
Submit comments in database when user clicks on submit button
Submit comments in database when user clicks on submit button... database when user clicks the submit button of the page. Create a database: First... be integer number then click submit button. If all the values are submitted
Facing Problem with submit and cancel button in same page - Struts
Facing Problem with submit and cancel button in same page  Hi, can u please help me out.I have placed submit and cancel button in the jsp page but i am unable to know how to write the form and action classes   Hi
storing details in database on clicking submit button - JSP-Servlet
database on clicking submit button. I am unable to do this.Can u tell me how to code...storing details in database on clicking submit button  I am using JSP in NetBeans and have developed an application form which has fileds naming
PHP HTML Form Submit Button
Topic : HTML FORM SUBMIT BUTTON Part - 4 The another part which is important to covered that is Submit button. If you are following all the previous parts... will ask in which it should be sent to the other page. The Submit button
how to disable submit button in jsp using servlet when some condition is satisfied
how to disable submit button in jsp using servlet when some condition is satisfied  how to disable submit button in jsp using servlet when some condition is satisfied
Retrive only requird data from a table in MYSQL databade to JSP file..on a field submit button.
Retrive only requird data from a table in MYSQL databade to JSP file..on a field submit button.  i have MYSQL DB,DB NAME:TRLIST, TABLE NAME:TR_LIST...;Submit> button===> i.e.,select node,package from tr_list where tr='yyy
Action Submit Html
clicks on a submit button, the form is sent to the specific address... a code, which helps you in creating a textfield and a submit button. When an user enter some text in the text field User name) and clicks the submit button
create text box by clicking button and submittong text in text box using submit
will click submit button the text should be submitted(it shows the value in text...create text box by clicking button and submittong text in text box using submit  Hi, I created a button when i click on button new textbox
insertin form data into databse and blank all form field when click on submit button
database when click on submit button and blank all form field after inserting...insertin form data into databse and blank all form field when click on submit...;</td></tr> <tr><td><input type="submit" value="Submit
submit a form
submit a form  How can we submit a form without a submit button
after entering details in reg page,n enter the submit button,how can v store the data in db, n hw can v retrive the data frm db in jsp
after entering details in reg page,n enter the submit button,how can v store... the submit button,how can v store the data in db, n hw can v retrive the data frm... to submit project in this week....   1)login.jsp: <html> <
disable and enable the submit buttons
disable and enable the submit buttons  i have two summit button in my form. one is disabled and other is navigating to the other page. after 3 submissions of the submit button the disabled one must be enabled and the enabled one
Button
Button  How to use image for button in JSF
Submit Articles
Submit Articles       Submit Articles at RoseIndia.net and Generate huge traffic and publicity... at RoseIndia.net has become very easy. We welcome all of you to submit your articles
button
button  can i give multiple commands on click of a button? if yes how can i do that?? multiple commands can be retriving dat from database, capturing data, moving to next page.. etc
button
button  can i give multiple commands on click of a button? if yes how can i do that?? multiple commands can we retriving dat from database, capturing data, moving to next page.. etc
Ajax form submit
submit. I want quick tutorial that will help me in writing form submit code in Ajax. Thanks   Hi, Read jQuery 'submit' form event tutorial. This tutorial teaches you how to submit form using jQuery framework. Thanks
Submit Error - WebSevices
Submit Error  Hello, Tell me the procedure for Storing Hidden values in one Iframe. Send the exact code for this problem
submit error - WebSevices
submit error  Tell me the combo box validation using java script. Ex: var hire = document.getElementById('cmbHire').value*/ if(document.frmProposal.hire.options[document.frmProposal.hire.selectedIndex].value=='0
html button
html button  when i click the submit button the entered data will be displayed below the submit button please help me
browse and submit the excel sheet into mysql as a table
browse and submit the excel sheet into mysql as a table  sir, i want to browse and after clicking a submit button, the data in the excel sheet should be stored in the mysql5.0 as a table
Submit Articles for Free
Submit Articles for Free      ....   Submit Articles To submit an article for possible inclusion... submit articles to help people "live the best life they can." We encourage all
Submit Your Article
Submit Your Article      ... & Profits for you, so you should strongly consider to submit your articles... Here are best Links to Submit Your Articles Submit Tutorials
more Submit buttons in the same form
more Submit buttons in the same form  Can I have two or more Submit buttons in the same form
Submit Tag (Form Tag) Example
tag that is used to render a submit button. The submit tag is used... the tag <s:submit> that renders a submit button. This tag contains various... of submit to use. Valid values are input, button and image.  In our case
Submit a Request for a Project to be done
Fill this form to Submit a Request for a Project to be done. Our development team will shortly contact you.   Visit Services section to submit your project details
jQuery 'submit' form event
jQuery 'submit' form event In this tutorial, we will discuss about the  'submit' form event of jQuery. In this example , In this example a text box and a button is given, when we hit the button, it will check
php form having 2 submit buttons
php form having 2 submit buttons  i have a php form and some text boxes.and 2 buttons"approve" and "disapprove". when i click on approve button... recipent and same with the disapprove button how to accomplish the above task.please
Multiple submit nuttons in single xhtml form - Java Server Faces Questions
this, and how can i make the particular submit button is applicable to a particular... button in different forms . For example in form1 have submit button name submitone...Multiple submit nuttons in single xhtml form  Hi, I am facing problem
JavaScript submit method
JavaScript submit method       We can submit forms in following two ways in an HTML page: By using submit button  Submitting form programmatically using JavaScript. 
Submit project to get developed
and presented here as questions. How do I Submit my Project ? Who can submit a project ? What type of projects can i submit ? What is the Payment Mode ? What
Submit Tutorials - Submitting Tutorials at RoseIndia.net
Submit Tutorials      ... to submit their tutorials at RoseIndia.net. We are big tutorial web site... us. How I can Submit Tutorial? Submitting tutorials at roseindia.net is now
button tag
button tag  how do i change button color to black. meant to say i want black button with white text on it   Hi Friend, Try the following... Message: <input type="text" id="msg"><br> <input type="button" value
jsp continuation button
jsp continuation button  i have 2 jsps, 1st jsp page with continue button and 2nd jsp with submit button.so how do i create a sessionvariable in order to submit the 2jspforms
Multiple submit buttons in single xhtml form - Java Server Faces Questions
Multiple submit buttons in single xhtml form  Hi all, Here I am attaching the source of the page , which containig two submit buttons. Somebody suggested to keep eaxh button in different form. I am new to JSF, can anyone split
wnidows button
wnidows button   How to handle windows back and forward button in struts applications, without using java script
very urgent, want to submit my project on monday
very urgent, want to submit my project on monday  i have the code for connected combo-boxes(jsp). But the thing i want to know is, how to access the values selected in those combo-boxes, for storing in database. in the case
radio button
radio button  On selecting a radio button, it should open a aspx page
Style in button
Style in button  Hi.... How can I set the button width with fx:style... of the button will not set by the style because it is the property of the button not the style property of the button. Thanks
 

 

 

DMCA.com