How do I clear the parameter after form post?

Hi. I am learning my first JSP and was trying to do a form post. However, I found that after successfully submit to the database. If I press F5 (Refresh) from browser, the data will be re inserted into database. How could I clear the parameter (action) after data insert. My code structure is as follow.
Thank you.
<%@ page import="java.sql.*" %>
<%! Connection conn;
PreparedStatement stmtInsert;
public void jspInit() {
try{ ... }catch(SQLException e){}
catch(ClassNotFoundException e){}
public void jspDestroy() {...}
%>
<% if (request.getParameter("action") == null ) { %>
<H2>Data Entry:</H2>
<FORM METHOD="post" ACTION="<%= request.getRequestURI() %>">
<INPUT TYPE="submit" NAME="Submit" VALUE="Submit">
<INPUT TYPE="reset" NAME="Reset" VALUE="Reset">
     <INPUT TYPE="hidden" NAME="action" VALUE="insert">
</FORM>
<% } else if (request.getParameter("action").equals("insert")) { %>
<%
try{
synchronized(stmtInsert){
stmtInsert.executeUpdate();
out.print("<br> Room has been inserted successfully");
// once successful...how could I change the action to null?
} catch (SQLException e){
%>

http://forum.java.sun.com/thread.jsp?forum=45&thread=78925

Similar Messages

  • I have an iMac for work and I am leaving the company. How do I clear the computer so that my soon to be former company is unable to see my personal information Ie. - internet, contacts, etc...

    I have an iMac for work and I am leaving the company. How do I clear the computer so that my soon to be former company is unable to see my personal information Ie. - internet, contacts, etc...

    Follow these instructions step by step to prepare a Mac for sale:
    Step One - Back up your data:
           A. If you have any Virtual PCs shut them down. They cannot be in their "fast saved" state. They must be shut down from inside Windows.
           B. Clone to an external drive using using Carbon Copy Cloner.
              1. Open Carbon Copy Cloner.
              2. Select the Source volume from the Select a source drop down menu on the left side.
              3. Select the Destination volume from the Select a destination drop down menu on the right
                  side.
              4. Click on the Clone button. If you are prompted about creating a clone of the Recovery HD be
                  sure to opt for that.
                   Destination means a freshly erased external backup drive. Source means the internal
                   startup drive.
    Step Two - Prepare the machine for the new buyer:
              1. De-authorize the computer in iTunes! De-authorize both iTunes and Audible accounts.
              2, Remove any Open Firmware passwords or Firmware passwords.
              3. Turn the brightness full up and volume nearly so.
              4. Turn off File Vault, if enabled.
              5. Disable iCloud, if enabled: See.What to do with iCloud before selling your computer
    Step Three - Install a fresh OS:
         A. Snow Leopard and earlier versions of OS X
              1. Insert the original OS X install CD/DVD that came with your computer.
              2. Restart the computer while holding down the C key to boot from the CD/DVD.
              3. Select Disk Utility from the Utilities menu; repartition and reformat the internal hard drive.
                  Optionally, click on the Security button and set the Zero Data option to one-pass.
              4. Install OS X.
              5. Upon completion DO NOT restart the computer.
              6. Shutdown the computer.
         B. Lion and Mountain Lion (if pre-installed on the computer at purchase*)
             Note: You will need an active Internet connection. I suggest using Ethernet if possible because
                       it is three times faster than wireless.
              1. Restart the computer while holding down the COMMAND and R keys until the Mac OS X
                  Utilities window appears.
              2. Select Disk Utility from the Mac OS X Utilities window and click on the Continue button.
              3. After DU loads select your startup volume (usually Macintosh HD) from the left side list. Click
                  on the Erase tab in the DU main window.
              4. Set the format type to Mac OS Extended (Journaled.) Optionally, click on the Security button
                  and set the Zero Data option to one-pass.
              5. Click on the Erase button and wait until the process has completed.
              6. Quit DU and return to the Mac OS X Utilities window.
              7. Select Reinstall Lion/Mountain Lion and click on the Install button.
              8. Upon completion shutdown the computer.
    *If your computer came with Lion or Mountain Lion pre-installed then you are entitled to transfer your license once. If you purchased Lion or Mountain Lion from the App Store then you cannot transfer your license to another party. In the case of the latter you should install the original version of OS X that came with your computer. You need to repartition the hard drive as well as reformat it; this will assure that the Recovery HD partition is removed. See Step Three above. You may verify these requirements by reviewing your OS X Software License.

  • How do I received the filled out form via email? After the user hits SUBMIT, I'd like to receive the filled out form via email.

    How do I received the filled out form via email? After the user hits SUBMIT, I'd like to receive the filled out form via email.

    Formscentral doesn't support direct delivery of filled forms via email at this time. You can however use Acrobat to add an email link to a form instead of a submit button. In this way the PDF will be returned to the email of your choice.
    Andrew

  • When I open a photo with Preview, it opens all the photos I have viewed previously.  How can I prevent that, other than manually clearing the list after each time?

    When I open a photo with Preview, it opens all the photos I have viewed previously.  How can I prevent that, other than manually clearing the list after each time?

    Close the pictures before you quit Preview. Cmd-opt-q will close all windows and quit. cmd-opt-w will close all windows and not quit.
    Or, Disable automatically opening files that were left open in General System Preferences

  • Ok, I made my form, and also experimented, now, how to I clear the cells of my "experiments" responses, to have none of the useless info?

    Floor Educational Guild's Resilient Flooring Technical Seminar Dalton, GA March 25-27, 2015!
    How do I clear the cells on the spread sheet? The filled cells are my learning / testing my forms.
    lee

    I'm afraid not.    It's not rocket science but you need to do some coding. 
    You'll need to find a script (php) and save it to your local site folder.  Then reference the script in your form's action attribute like so.
         <form action="path/form-to-email-script.php" >
    The input fields in your HTML form need to exactly match the script variables. 
    I'm  assuming you're hosted on a Linux server which uses PHP code.  Linux servers are also case sensitive, so upper case names are not the same as lower case names.  It's usually best to use all lower case names in your form and script to avoid confusion.
    Related Links:
    Formm@ailer PHP from DB Masters
    http://dbmasters.net/index.php?id=4
    Tectite
    http://www.tectite.com/formmailpage.php
    If this is all a bit beyond your skill set, look at:
    Wufoo.com (on-line form service)
    http://wufoo.com/
    Nancy O.

  • How can I change the parameters in form

    Hi there,
    I´m creating a WD application with add and change data.
    The change form it´s ok and works fine, but I want to use the same form to add data too...
    But the change from has some element "read only", how can I change the parameter in this form and clean the other elements?
    Thanx a lot

    hi minoru.....
    consider you are having an input field....
    create an attribute of type string in the context.
    bind it to the read only property of the input field.
    now pass the value x to the input field, to make it read only  or pass '' to make it read write.
      DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
      DATA lv_read_only LIKE ls_context-read_only.
    * get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    *********read_only is the attribute name bound to the read only *********property of the input field.
    * get single attribute
      lo_el_context->set_attribute(
          name =  `READ_ONLY`
          value = '' ). *** you can pass x to make it read only
    ***** to clear the values
    lo_el_context->set_attribute(
          name =  `INPUT_MATNR` * this clears my input field.
          value = '' ).
    ---regards,
       alex b justin

  • How to return a html repsonse after form guide rendering in browser?

    How to return a html repsonse after form guide rendering in browser indicating that server has recieved transmission and request is submitted succesfuly?
    I am rendering the form guide in browser using guide invoke service and when i submit the data in browser to server through guide , it is displaying some random number in browser?
    i need to display a resposne that request is submitted successfully?

    how could i define a variable with "html data" ?
    Create a variable of type document and then a service to read the html from where ever it's located. If you put it in LiveCycle, you can use the ReadRessource service. If it's on the file system, you can use the Read Document. If it's in the database, you can use the JDBC service.
    Also, one more doubt where should i use this variable in my process to get the same?
    You want the response once you've submitted the data, so the html is really the result of calling the process that's processing the data. So I would create an output variable of type document on that process.
    Right now it displays a random number in the browser because your submit process is long lived. When a process is long lived (asynchronous), you invoke it and then you get an identifier back. It's kind of a fire and forget. You can use that identifier to check the status of the long lived process, since long lived processes can take hours, days to complete. You don't want your browser to wait that long, hence the identifier.
    However if you change the process to be short lived (synchronous), the browser will wait for the result of the process, which really means the output variables for that process. If your output variable contains html, it'll display html.
    So the key is make you submit process short lived and populate the output variables appropriately.
    Jasmin

  • I have forgotten my password and locked my phone, how can i clear the problem

    I have forgotten my password and locked my phone, how can i clear the problem

    By coincidence, this happened to my son just last night.  You do NOT have to restore it to a new phone, but you probably want a current backup.
    Luckily, you can still sync and back it up even if it's locked, so connect it to the computer you usually sync it to. Go to the summary page. It's easiest and fastest to use a local backup, so if iCloud backup is on, turn it off and click "Backup now".  
    After it backs up, either click "Restore iPhone", or
    - hold home and the top button until the screen goes black, release the top and continue to hold the home button until iTunes says "iPhone in recovery mode detected". 
    Follow instructions to restore from backup, and then sync to restore content.  Your phone will come up in an unlocked state. If you have any stuff that was purchased directly to the iPhone (only), you'll have to re-download it. 
    Remember to turn iCloud backups back on if you use them.
    If you don't sync you iPhone to a computer then I *think* those instructions with the buttons will put it into a mode where you can restore it from the cloud (make sure it is NOT connected to a computer while you do this). Otherwise, you will have to restore it as a new phone, then go to settings, reset, then restore it from the cloud.

  • How can I clear the stored browsing history in iCloud?

    As the headline says, how can I clear the stored browsing history in iCloud?
    After resetting my iPhone, previous history came back as soon as I signed in with iCloud on it. I would really like this to not occur.

    The only place that Thunderbird gets suggested addresses is from your address books. I have seen some not show up in the books because some key info was never stored when the contact was saved.
    Sometimes you can start a new message and when the bad contact shows up select it. Create the message and save it to drafts. Then you can go to the Draft folder open the draft message by right clicking and select Open Message in Tab. Then click the star to the right of the contact and it will open the contact edit button. From there you can delete the contact.
    This does not always work though.

  • Waveform Graphs: Is there a way to save data to a file and then clear the graph after each run?

    This is just an added feature that I would like to insert because I end up having to erase the previous graph(for viewing and simplification purposes) after almost every plot cycle. Does LabVIEW 7.0 have a built-in feature that allows the user to automatically clear the graph after each run.
    Thank you,
    Keith Blackwell

    May I recall you that to clear a graph you have to create a property node,
    choose value and connect an 1D array with its first value to zero.
    Then using a Select vi enables you to choose from clear or graph value.
    Gérard
    Gérard Férini
    Switzerland
    http://home.tiscalinet.ch/gferini/
    remove -move to reply personally
    "Greg McKaskle" wrote in message
    news:xEmJc.43762$[email protected]..
    > > I went into the function pallette-->signal manipulation-->align and
    > > resample
    > >
    > > and found something that may be useful, but I'm not sure how to use
    > > it. I guess I have to play around with it by trial and error. Was this
    > > the VI seetting that you were referring t
    o?
    > >
    >
    > The option I was talking about is for the entire VI. It resets the
    > value of all indicators prior to running. The setting is located in the
    > VI Properties dialog on the execution page I believe. In the end, there
    > are multiple ways to get this to work, and if you want just a few
    > indicators to be reset, you want to use locals or control methods, but
    > th eVI Properties is a convenient way to get all indicators cleared at
    once.
    >
    > Greg McKaskle
    >

  • How do I Clear the Cache in Safari 6.1 ?

    How do I Clear the Cache in Safari 6.1 ?
    In previous versions hitting Reset Safari did this, but not so, in the latest version. Some Browsing info is still stored after Resetting.
    I try and be cautious with Web Browsing, and even though Mac's a almost immune to Viruses / Mal-ware threats etc., it's still gives Peace of Mind, to know you're able to 'Delete your Tracks' after browsing the Web

    If you enable the Develop menu from Safari - Preferences - Advanced : there's a menu item Safari - Develop - 'Empty Caches' & accompanying shortcut.

  • How Do I Clear the app download screen

    How do I clear the app update screen after I have updated the apps.

    TThe apps do not delete.  Apple has not programmed this I to the system.  Keep on letting them know that this clutter is not necessary.  Everyone was used to the old system, update and disappear when done.  I do not like the clutter myself.  Keep on asking apple to fix this.  

  • How do I clear the recent opened item files on Adobe Illustrator CS3?

    Dear Gentlemen:
    How do I clear the left side of the Adobe Illustrator CS3 welcome menu that contains the most recent items opened?
    I just want the recent items be erased.
    Much help is appreciated.
    Thanks
    etow

    Hi Mylenium,
    Mylenium wrote:
    That info is stored in the registry on Windows and in a file in the Library on the Mac. nothing you can erase easily, but if you are feeling adventurous, on windows you could launch regedit, then search the registry for HKEY_USERS\[your user ID numeric key]\Software\Adobe\MediaBrowser\MRU\illustrator.
    Mylenium
    Edit: Please change your user name to not represent an e-mail address it invites spam bots and may actually get you a lot of extra mail...
    What is "[your user ID numeric key] "  in the registry HKEY_USERS\[your user ID numeric key]\Software\Adobe\MediaBrowser\MRU\illustrator
    that you mentioned above?
    After I find this registry key in Windows XP Home Edition Service Pack 3, then how do I modify this registry key?
    I am having trouble to modify my existing  Adobe ID to change it to a different ID not my email address.
    Please reply back soon.
    Sincerely,
    etow

  • How do I clear the "drop down menu" of past titles I have searched for?

    How do I clear the drop down menu of titles that have been searched for in the past? Example; If I type in a word such as craig, then craigslist appears in the drop down menu, how do I clear this?

    Use these steps to remove saved (form) data from a drop-down list:
    #click the (empty) input field on the web page to open the drop-down list
    #highlight an entry in the drop-down list
    #press the Delete key (on Mac: Shift+Delete) to remove it.
    *http://kb.mozillazine.org/Deleting_autocomplete_entries

  • How can I clear the "Purchased" apps?

    How can I clear the "Purchased" apps list from the "Not on This Iphone" list of the Updates section of the App Store on my Iphone 4?
    There is no clear function.  If I Erase All Content and Settings in General Settings will that do it?  It'd be nice not to have to do that and erase all my data and media.

    Nick, you had the right idea.  Success!  I changed my email address on my Apple ID.  Then went to my Iphone and under Settings, iTunes & App Stores, press on AppleID: (I.D.inserted), Sign Out, Create New Apple ID.  Used the original Apple ID email address to create a "new" Apple ID, going through the whole set up process again, including billing info.  Then, when opening the App Store app there are no Purchased apps to display, because there are none on this "new" account.  The old account still exists in Apple cyberspace, but it is not tied to my iPhone or iTunes anymore.  There does not appear to be any way to delete an Apple ID.  Maybe after a few centuries Apple will discard it.  Maybe not.

Maybe you are looking for