Buttons in HTML Forms attached to servlets

Hi,
This seems like it should be a simple thing to me, but I haven't done enough html (or maybe it's enough servlets) to know what to do here.
I have a section of my webpage that is entirely servlet-based. On one page (created by a servlet), I have a form. I'd like to put two buttons on the bottom of this form and be able to distinguish which one was pushed. The form sends to another servlet and I am getting other data out of the form in that servlet. (Text fields, which is text input type, that show up in the requestParameters). I tried the following:
out.println( "<input type=\"submit\" value=\"Button1\" name=\"button1\">" );
out.println( "<input type=\"submit\" value=\"Button2\" name=\"button2\">" );in the servlet that the form connects to, I tried the following:
String buttonOne = request.getParameter( "button1" );
String buttonTwo = request.getParamter( "button2" );
if(buttonOne != null)
     System.out.println( buttonOne );
if(buttonTwo != null)
     System.out.println( buttonTwo );
}But when I do this, nothing prints to the screen, so obviously it isn't right.
Anyways, if anyone could tell me a way I could tell which button was clicked, that's all I want!!!
Thanks for any help you might give!!

But when I do this, nothing prints to the screen, so obviously it isn't right.And don't expect System.out.println() in a servlet to print to any "screen". It certainly won't appear in the browser in response to your request; it should appear in one of your servlet container's log files. If it doesn't, then use the servlet log() method instead. Or just generate HTML containing your debugging output and send that back as the response.
PC&#178;

Similar Messages

  • Validating HTML form generated by servlet

    Hi, folks. I have a dynamic html form generated by a servlet class. Once user fills up the form and submits it, i have another servlet does the form validation. My question is how can i reload the generated html form with error messages when user's inputs failed validation?
    I am not able to use JavaScript pop-up windows for doing validation cause the page will be displayed on PDA and cell phone as well. Any help is greatly appreciated.

    Could you combine the servlets.
    I'm not sure but then you may be able to have the generator servlet in the doGet method and the validator in the doPost method. (don't quote me on this)
    If you combine the servlets you have access to the original data (the form), that way if any validation errors occur you can repost the form with their entered data and an error message.

  • Captivate button with HTML form action

    Hello,
    How would I create a button in Captivate 6.0 that would perform the following action below?
    <form method="post" action="https://suppliers.company.com/tracker/reg/CourseReg.cfm">
    <input name="submit" type="submit" value="Receive Credit">
    <input name="CourseId" type="hidden" value="TR001234">
    </form>
    I though it would be simple, but not sure what to use. If it should be vaiables, advance actions or javascript?
    thanks!

    You havent closed these two tags
    Sex :
    <html:radio property="sex" value="M">Male
    <html:radio property="sex" value="F">Female<br>ram.

  • Error when using a HTML form along with a servlet

    Hi All,
    I am using Sun Studio 4 to create a HTML form that takes in 4 inputs and then
    passes them on to a servlet to be processed.
    In my HTML form i have the form heading.. <form method = post action="processServlet">
    my directory structure is as follows:
    /home/cosmo/projects/testservlet/processServlet ... processServlet being the servlet underneath the testservlet directory.
    inputForm.html is also under the same testservlet directory. I am running TOMCAT.. and under the run time tab under tomcat --> Internal --> it has localhost:8081 and under that the default context is /home/cosmo/projects/testservlet
    NOW, when i execute my HTML page the URL on top says "http://localhost:8081/inputForm.html
    which seems correct. I get my form correctly. When i input the data,and i hit the submit button, the URL says "http://localhost:8081/processServlet" which i think is also correct, but i get a "404 Error and the error description says " The requested resource( /processServlet)
    is not available." I have coded the servlet to give me just a few lines of output, but instead, the above error shows up.
    Why would this be happening? Do i have my directory structure messed up? Do i have the wrong type of template? I used a web module to do this. I also compiled my Servlet from Sun Studio without any errors.
    Any help would be appreciated.
    Thanks
    Kal.

    You can't post directly to a servlet the way you can to an HTML or JSP page. You must map your requests to specific servlets for the request to get directed there. There are entries in the web.xml for this.
    You need to map the request for "processServlet" to "edu.xxx.yyy.processServlet", or the servlet engine won't know what to do with that request.
    Often times, an app will route all requests for a particular extension to a router servlet, which then figures out which class to actually send the request to. This keeps you from having to map all servlets in the web.xml file.

  • How to use many submit buttons in an one html form

    I'm doing a simple program to insert, edit, delete data from a web page to an database
    but the problem is that in an html form , you are allowed to put only 1 submit button.
    I heard that you can take the action of many buttons, for a one form using java script
    if anyone have a better idea or else have this simple java script, please help me
    Thank you very much

    Give the buttons an unique name.
    In the servlet just check if the button is pressed or not by determining if HttpServletRequest#getParameter() doesn't return null for the button name.There are a couple of "gotchas" when using this technique of dispatching with certain html controls. Most of them browser related.
    If you are using <input type="image" name="myButton"> as a submit button, be aware that Internet Explorer will submit the parameters "myButton.x" and "myButton.y" giving the x,y co-ordinates of where you clicked on the button. And won't submit any other value. So calling request.getParameter("myButton") would return null. You have to test for request.getParameter("myButton.x");
    If you are using <input type="button" name="myButton"> with Internet Explorer all of the buttons are deemed "successful". So calling request.getParameter("myButton") will never return null.
    At least thats the way it works in IE6. And thats what I'm stuck with at work right now, so thats what gets used. It may be fixed in later versions, but I don't have any info on that.
    Cheers,
    evnafets

  • Parts HTML form Expand All(Show button) option needs to customize.

    Hi,
    I am new to OAF.
    I have a requirement lin Oracle Sparse Management -> Parts HTML Request Form needs to Personalize/Customize for a business requirement.
    I have some qusetions like
    1. Can we customize or personalize the Show All Details or HideAll Details options in OA Forms ?
    2. If Yes, i have similar requirement like that,
    The personalization aim is show all details should be expanded by default.
    3. If No please provide why it can not be achevable.
    Here is business reuirement in parts Html, there are two regions in page 1. Header 2. Lines (Under Lines there are two table 1 is for Item information search and 2nd is for order details based on the item. This order details are hided under the Item information table one of the field button Show(which is like Expand All with symbol +))
    Page works like below.
    1. Header level validations are there for some fields like Resource, Need By Date.
    2. Once Valid from header can be entered the Item information search in Lines details Region, in the same table there is an option with + symbol (Show), which is like Expand All.
    will validate the item details and displays Order details respective to item. These results are hide under + Show button.
    If i want see the order details then i need to perform click action on the +Show button. (Requirement is this should be done automatically once i have entered the item in Line Details Region and needs to display the results).
    Please provide your seggestions to acheive this.
    Thanks,
    Narayana Swamy

    For this i have tried below steps to extend related VO of SHow button field.
    Below steps i have perforemed.
    1) Identified the right VO from about this page.
    ReqLineVO
    2) Exported the related standard VO to JDEV from Server.
    ReqLineVOImpl.java, ReqLineVORowImpl.java, ReqHeaderVO, RequirementAM, RequirementAMImpl.java
    3) Created a new VO which extends the standard VO and modified Showhide flag to ‘Y’
    HolxReqLineVO, HolxReqLineVOImpl.java, HolxReqLineVORowImpl.java
    4) Performed substitutions in Jdeveloper
    Project Properties -> Business Components -> substitutions
    5) Have created custom folder structure in server and moved custom VO files to server.
    \holx\oracle\apps\csp\portal\requirement\server\HolxReqLineVO.xml
    6) Performed JPX import
    1. Go to E:\jdev10g\jdevbin\oaext\bin
    2. Executed the below command
    jpximport E:\jdev10g\jdevbin\jdev\myprojects\OAProject4.jpx -username apps -password th1rdapps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)
    (HOST=mycomapny.com)(PORT=1526))(CONNECT_DATA=(SID=TESTDB)))"
    7) After this bounced apache.
    8) While trying to open the parts html form, below exception is occurring.
    Error Page
    Exception Details.
    oracle.apps.fnd.framework.OAException: Could not load application module 'oracle.apps.csp.portal.requirement.server.RequirementAM'.
         at oracle.apps.fnd.framework.webui.OAJSPApplicationRegistry.registerApplicationModule(OAJSPApplicationRegistry.java:279)
         at oracle.apps.fnd.framework.webui.OAJSPApplicationRegistry.registerApplicationModule(OAJSPApplicationRegistry.java:78)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1306)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:549)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:437)
         at OA.jspService(_OA.java:212)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:473)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:734)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
         at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:280)
         at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:68)
         at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:214)
         at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:284)
         at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:219)
         at com.evermind.server.http.EvermindPageContext.forward(EvermindPageContext.java:395)
         at RF.jspService(_RF.java:225)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:473)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
         at oracle.apps.jtf.base.session.ReleaseResFilter.doFilter(ReleaseResFilter.java:26)
         at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
         at oracle.apps.fnd.security.AppsServletFilter.doFilter(AppsServletFilter.java:318)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:642)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:391)
         at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:908)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:458)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:313)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:199)
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
         at java.lang.Thread.run(Thread.java:662)
    ## Detail 0 ##
    JBO-30003: The application pool (holdb01.dataintensity.comHOLDEV1524oracle.apps.csp.portal.requirement.server.RequirementAM) failed to checkout an application module due to the following exception:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.InvalidOperException, msg=JBO-26036: Recursive substituion for holx.oracle.apps.csp.portal.requirement.server.HolxReqLineVO.
    ## Detail 0 ##
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.InvalidOperException, msg=JBO-26036: Recursive substituion for holx.oracle.apps.csp.portal.requirement.server.HolxReqLineVO.
    ## Detail 0 ##
    oracle.jbo.InvalidOperException: JBO-26036: Recursive substituion for holx.oracle.apps.csp.portal.requirement.server.HolxReqLineVO.
    JBO-30003: The application pool (holdb01.dataintensity.comHOLDEV1524oracle.apps.csp.portal.requirement.server.RequirementAM) failed to checkout an application module due to the following exception:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.InvalidOperException, msg=JBO-26036: Recursive substituion for holx.oracle.apps.csp.portal.requirement.server.HolxReqLineVO.
    ## Detail 0 ##
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.InvalidOperException, msg=JBO-26036: Recursive substituion for holx.oracle.apps.csp.portal.requirement.server.HolxReqLineVO.
    ## Detail 0 ##
    oracle.jbo.InvalidOperException: JBO-26036: Recursive substituion for holx.oracle.apps.csp.portal.requirement.server.HolxReqLineVO.

  • Controling HTML form Radio Button

    I'm working on automating the check-in and check-out of items in a process queue, but the process queue is web-based. I can input usernames, lot IDs, passwords, and "press" submit buttons programatically by using ActiveX IWebBrowser2 properties (and related).
    Here's what I currently have, mostly stolen from a post from 2005.
    The Old Post:
    http://forums.ni.com/t5/LabVIEW/How-to-fill-out-and-submit-a-web-form-using-LabVIEW/m-p/1018248/high...
    As I said, I can input usernames and passwords and submit the form, but I am having trouble setting the value of a Radio button.
    Here's a snippit of what I'm trying, and my VI is attached. I've also attached the relevant HTML.
    Solved!
    Go to Solution.
    Attachments:
    web page radio button HTML.txt ‏2 KB
    WIPTrac experiments.vi ‏23 KB

      Hello,
    I have a html form compounds in two fields first and last name and a sibmit button, how can I control it in labview
    Attachments:
    form.png ‏60 KB
    forme.vi ‏19 KB
    form.txt ‏1 KB

  • Help : Calling a Servlet.doPost from a HTML Form (404 Error !!!)

    All
    I trying to make a call to a doPost method of a servlet from the doGet method of the same servlet.
    The call is made from an HTML form, so
    *<form name="input" action="servlet/deleteAlertPage" method="post">*
    ======================================================================
    The web.xml file entry is as follows:
    *<servlet>*
    *<servlet-name>deleteAlertPage</servlet-name>*
    *<servlet-class>bsp.perceptive.custom.webapp.deleteAlert.deleteAlertPage</servlet-class>*
    *<load-on-startup>0</load-on-startup>*
    *</servlet>*
    *<servlet-mapping>*
    *<servlet-name>deleteAlertPage</servlet-name>*
    *<url-pattern>/deleteAlertPage</url-pattern>*
    *</servlet-mapping>*
    So when I run my Servlet from my JDeveloper, I do see the “doGet” method getting executed successfully and I see my HTML from appearing on a browser page.
    As soon as I press the submit button, where I want the “doPost” method to get executed, I get the following error:
    Error 404--Not Found
    From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
    *10.4.5 404 Not Found*
    The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.
    If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead.
    The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource
    is permanently unavailable and has no forwarding address.
    Any ideas ? Is my Servlet Setup and Execution Correct ?
    Any help is appreciated.
    My JDeveloper Version is the latest release :
    About
    Oracle JDeveloper 11g Release 1 11.1.1.2.0
    Studio Edition Version 11.1.1.2.0
    Build JDEVADF_11.1.1.2.0_GENERIC_091029.2229.5536
    Copyright © 1997, 2009 Oracle and/or its affiliates. All rights reserved.
    IDE Version: 11.1.1.2.36.55.36
    Product ID: oracle.jdeveloper
    Product Version: 11.1.1.2.36.55.36
    Any help and advice is greatly appreciated.
    Regards
    patrice

    John
    I got it to work !!
    I had to place the application name in the action value also I had to change the port number, from 8080 to be 7101.
    However
    It was not that straight forward, because when I created my web Application I gave it the application Name of "BSPCustPerWebApps" and Project Name of "BSPCustPerWebApps"and this is reflected in my JDeveloper folder structure: "....\mywork\BSPCustPerWebApps\BSPCustPerWebApps\src\bsp\perceptive\custom\webapp\deleteAlert"
    now when I run my Servlet initially I noticed that Browser URL is saying : http://localhost:7101/BSPCustPerWebApps-BSPCustPerWebApps-context-root/deleteAlertPage
    which means that the web application is : BSPCustPerWebApps-BSPCustPerWebApps-context-root
    so I changed my action value to be
    action="http://localhost:7101/BSPCustPerWebApps-BSPCustPerWebApps-context-root/deleteAlertPage"
    and that worked.
    Weblogic must have created/defauled the application name using the application name and project name that I gave duriung the servlet creation.
    Is there a way of changing the application name to be something shorter and more meaningfull ?
    Also I did not want to hard code the server name, port etc in the action value, so again is there way of making this to be derived ?
    Do you know how to access the WebLogic Console ? , considering I have only installed JDev, which has an embedded weblogic server.
    Thanks for your help.

  • How to make custom html form buttons - here's a way to do it.

    I have been trying to create custom HTML form rollover submit/Reset buttons but could not get it going.
    There is a Javascript way but I do not know how.
    Anyway, I manage to get it working in all browsers except for IE 6. It does not hover in IE 6.
    Here is the HTML code:
    <label class="contact_form_btn">
    <input type="submit" name="submit_btn" class="contact_form_submit_btn" value="Submit form" />
    </label>
    And here is the CSS:
    .contact_form_btn, .contact_form_submit_btn {
        margin: 0;
        padding: 0;
        display: block;
        line-height: 40px;
        height: 40px;
        width: 200px;
        font-family: "Century Gothic", "Trebuchet MS", Verdana, Tahoma;
        font-size: 20px;
        color: #FFFFFF;
        font-weight: bold;
        float: left;
        background-image: url(../my_website_images/form_btn_set.jpg);
        background-repeat: repeat-x;
        background-position: bottom;
    .contact_form_btn {
        background-image: url(../my_website_images/form_btn_set.jpg);
        background-repeat: repeat-x;
        background-position: bottom;
    .contact_form_submit_btn {
        background: transparent;
        border: none;
        cursor: pointer;
        float: left;
        clear: left;
    .contact_form_btn:hover {
        background-image: url(../my_website_images/form_btn_set.jpg);
        background-repeat: repeat-x;
        background-position: top;
    It works perfectly but not in IE 6.
    In IE 6 the image does work but there is no hover effect.
    I'm using it anyway - screw it.
    But for the sake of learning and advancement  - does anybody have an idea why it will not rollover in IE 6?

    JoeyD1978 wrote:
    You can use an HTC to fix the hover on IE6:
    http://www.danvega.org/blog/index.cfm/2008/1/1/CSS-hover-selector
    Hello,
    I read the information on the link you posted but I'm a litle confused as to how this is implemented.
    There is nothing mentioned about attaching a script to the document.
    All I read is that you add this to the body:  body {    behavior: url("csshover3.htc"); }
    And so my question is. The files that you download, where do you put them? Do you attached them to the header of the html page?
    Or do you pull them through the url that's attached in the CSS page body?
    I have contacted the author but if you know the answer, please explain further.
    Thanks again, Patrick

  • Uploading an image to a servlet with out  html form

    Hello,
    I had a look around the forum and could not find an answer to my question.
    I am trying to unload an image that is in a byte array to a servlet. the image is on the mobile phone. the mobile phone does not have html form to upload the picture.
    Is there any other way of uploading instead of using html form to invoke the servlet. It is just the connection bit that is confusing me. When the servlet is invoked then it can open an inputstream and take in the image.
    I hope this is clear and that some one else has done it.
    thanks
    martin

    search here and/or search google for "send byte array to servlet"
    it's certainly easy to find as far as i can tell
    first google result:
    http://forum.java.sun.com/thread.jspa?messageID=10173137&tstart=0

  • Uploading File To MySQL from HTML form via Servlet

    Hello all !
    I hope this is better place to ask.
    I'm working on simple Servlet/Jsp application trying to hold to MVC pattern and got stuck on uploading file to MySQL db.
    Here's what I'm trying to accomplish:
    1) client submits a JPEG image via a simple html form on a webpage.
    2) JPEG is put into a database table, column field of type BLOB.
    3) Servlet processes the request, gets a connection to the db and inserts the image into the table.
    4) after that user is able to retrieve an image from db and display it in JSP page.
    This is pretty much the same task Angela was trying to do here:
    http://forum.java.sun.com/thread.jspa?threadID=667597&messageID=3905449
    I could use her snippets if i knew what is what and decided to figure out this myself. Aftet some investigation i found out that i need to import org.apache.commons.fileupload.*;which i found here: http://jakarta.apache.org/commons/fileupload/
    what am i driving at ?
    -----------------------1-----------------------
    After first line of code
    boolean isPart = FileUpload.isMultipartContent(request);netBeans 5.5 beta2 with bundled Tomcat 5.5.17 underlines this with warning saying that
    org.apache.commons.fileupload.FileUploadBase
    has been depreceted
    is it a reason for concern ?
    -----------------------2-----------------------
    Is it actually good idea to store images in db as blob ?
    what about large ammounts of text ?
    thank you
    -Dominik

    is it a reason for concern ?Yes.
    You should take a look at the method in the documentation and find out exact reason for depricating it.
    If it is depricated becouse they going to remove it in the future you should use the new alternative method becouse if you use the old method your app will not work in the future releases of the API.
    If it is depricated becouse it is not safe to use the method you should clearly understand the risks involved in using the method and see if that can give you any trouble in your project.
    -----------------------2-----------------------
    Is it actually good idea to store images in db as
    blob ?I think that it is ths best option available when you want to store binary data
    what about large ammounts of text ?You can use clob columns.
    By the way when you store files in the database its better you put some extra columns to store the file name and file type(mime) becouse you cant directly detect those things later by just looking at the data of the file.

  • Working with 2  submit buttons in a html form

    I have 2 submit buttons in a form. I will upload a file and save in a filepath in server when I click on one "upload" button. I want to use this file path in the code when I click on another button called"Process".  When I click the process nothing is happening with dump in below code.Form  submits to itself. Is there any better way to do this. Thanks in advance.
    <table width="40%" border="0" style="border: 1px solid black;">
              <form  name="uploadform" action="processfile.cfm" enctype="multipart/form-data"  method="post">
              <tr>
                        <td><input type="file"  name="FileContents" size="25">
                            <input type="button" name="action" id="action" value="Upload">
                        </td>
              </tr>
              <tr>
                        <td align="middle">
                                  <input type="button" name="submitaction" id="process" value="Process">
                          </td>
              </tr>
              </form>
        </table>
    <cfset variables.filepath ="">
    <cfif isdefined("form.action") AND form.action eq "upload">
                 <cffile action = "upload"  fileField = "FileContents" destination = "C:\test\" accept = "text/plain" nameConflict="overwrite">
              <cfset variables.filepath= "C:\test\#cffile.serverFile#">
    <cfelseif isdefined("form.submitaction") AND form.submitaction eq "process">
              <cfdump var="#variables.filepath#">
    </cfif>

    Hi tburra,
    You can try the below code. This dumps the value of the path as well.
    <cfif isDefined('Form.tmpfile1')> <cfset root = ExpandPath("/Upload")><!---location where file should be uploaded---> <cfset filename=GetFileFromPath(Form.tmpFile1)> <cfset FileExt=ListLast(filename,".")> <cfset variables.filepath =""> <cfset filename = "BidDocument1." & FileExt>  <cffile action="upload" filefield="BidDoc1" destination="C:\Upload\" nameconflict="overwrite" accept="application/pdf,application/msword,application/vnd.ms-excel,text/plain,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"> <cfset variables.filepath= "C:\test\#cffile.serverFile#"> <cfdump var="#variables.filepath#"> </cfif> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cffileupload Document</title> <form name="form1" enctype="multipart/form-data" method="post"> <input type="hidden" name="tmpfile1" value="" /> <input  type="file"  name="BidDoc1"  onchange="setFile(this.form);" /> <input type="submit" name="save1" value="Upload" /> </form> <button onclick="location.href='processfile.cfm'">Process</button> </html>
    This should help you.
    Regards,
    Anit Kumar

  • JDBC + SERVLET: inserting text data  to access file from Html form

    Hi everybody !
    I'm trying to insert text data from my html form to access database using servlet and jdbc technologies.
    The problem that I'm that the data is TEXT, but not the English language !!!
    So my access db file gets - ???????? symbols instead the real text.
    This is the form line that sending data to my servlet:
    <form
    method="POST"
    ACTION=http://localhost:8080/servlet/myServlet enctype="text/html">
    And this is servlet line that defines response content:
    res.setContentType( "text/html" );
    What can I do to get in access db file the right text format and not a ???????? symbols.
    Maybe I must to ad some <meta ...> , but where ?

    You're dealing with Unicode, I'd guess, and not ASCII.
    I guess I'd have two questions:
    (1) Is the character encoding on your pages set properly for the language you're trying to use?
    (2) Does Access handle Unicode characters?
    Access isn't exacly a world-class database. (If it was, there'd be no reason for M$ to develop SQL Server.) I'd find out if it supports other character sets. If not, you'll have to switch to a more capable database that does. - MOD

  • Calling PLSQL Stored Procedure From HTML Form Submit Button

    Hi there,
    I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
    HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
    HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
    HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work.
    Lets call them class_number, term, conf These three variables will be passed and the data will be deleted and the person will see a confirmation screen once the delete query has been executed.
    So ideally I would want: ZWGKERCF.P_confdelete(class_number, term, conf) and then the stored procedure would handle the rest!
    Seems pretty simple but I am not sure how to make this happen... My thoughts were:
    Pass the data to this html form (the three fields I need) in hidden variables. Then somehow pass these using POST method to the procedure and read using GET?
    Can someone clarify what the best way to do this is? I have a feeling its something small I am missing - but I would really like some expert insight :-)
    Thanks so much in advance!
    - Jeff

    795018 wrote:
    I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
    HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
    HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
    HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work. The browser generates a POST or a GET for that form action, that includes all the fields defined in that form. Let's say you define HTML text input fields name and surname for the form. The URL generated for that form's submission will be:
    http://../ZWGKERCF.P_confdelete?name=value1&surname=value2The browser therefore submits the values of the form as part of the URL.
    The web server receives this. It sees that the base URL (aka location) is serviced by Oracle's mod_plsql. It passes the URL to this module. This module builds a PL/SQL block and makes the call to Oracle. If we ignore the additional calls it makes (setting up an OWA environment for that Oracle session), this is how the call to Oracle basically looks like:
    begin
      ZWGKERCF.P_confdelete( name=> :value1, surname =>  :value2 );
    end;Thus the PL/SQL web enabled procedure gets all the input fields from the HTML form, via its parameter signature. As you can define parameter values with defaults, you can support variable parameter calls. For example, let's say our procedure also have a birthDate parameter that is default null. The above call will still work (from a HTML form that does not have a date field). And so will the following URL and call that includes a birth date:
    URL:
    http://../ZWGKERCF.P_confdelete?name=value1&surname=value2&birthdate=2000/01/01
    PL/SQL call:
    begin
      ZWGKERCF.P_confdelete( name=> :value1, surname =>  :value2, birthdate => :value3 );
    end;There is also another call method you can use - the flexible 2 parameter interface. In this case the PL/SQL procedure name in the URL is suffixed with an exclamation mark. This instructs the mod_plsql module to put all input field names it received from the web browser into a string array. And put all the values for those fields in another string array. Then it calls your procedure with these arrays as input.
    Your procedure therefore has a fixed parameter signature. Two parameters only. Both are string arrays.
    The advantage of this method is that your procedure can dynamically deal with the web browser's input - any number of fields. The procedure's signature no longer needs to match the HTML form's signature.
    You can also defined RESTful mod_plsql calls to PL/SQL. In which case the call format from the web browser looks different and is handled differently by mod_plsql.
    All this (and more) is detailed in the Oracle manuals dealing with mod_plsql - have a search via http://tahiti.oracle.com (Oracle Documentation Portal) for the relevant manuals for the Oracle version you are using.
    Alternatively, simply download and install Oracle Apex (Application Express). This is a web development and run-time framework and do all the complexities for you - including web state management, optimistic locking, security and so on.

  • Displaying images in HTML Forms inside Servlets

              Dear friends
              How are you?
              I am developing Servlets in WebGain Studio Pro V4.1 VisualCafe
              V4.1 to display dynamic HTML forms with embedded
              images (*.jpg and *.gif).
              Please see the following sample code -
              "<DIV ID=\"Logo\" STYLE=\"position:absolute; left: 4%; top: 4%;
              width: 25%; height: 12%; z-index:1; visibility:visible\">" +
              "<IMG SRC=\"FigLogo.gif\" WIDTH=\"100%\" HEIGHT=\"100%\">" +
              "</DIV>"
              Then I deploymed servlets to BEA WLS 6.0 by including Servlets
              in the Web.xml file. However, I do not see the images when
              viewed in IE5.0 browser.
              I appreciate all comments and suggestions.
              Thanking you
              Very truly yours
              Sriram (Ram) Peddibhotla, PhD
              

              Dear Friends
              How are you?
              I moved all images (*.jpg, *.gif) to the subdirectory
              /myDomain/applications/DefaultWebApp_myServer/images
              and they are displaying now in the servlets with HTML forms.
              Thanking you
              Very truly yours
              Sriram (Ram) Peddibhotla, PhD
              "Sriram (Ram) Peddibhotla" <[email protected]> wrote:
              >
              >Dear Friends
              >
              >How are you?
              >
              >When the Servlet displays in the browser (IE5.0), when I click on where
              >the image
              >should be, I see the path
              >http://localhost:7001/servlet/FigureName.jpg (????). Why did it add
              >the /servlet
              >part to the path, I thought that was exclusively for deploying servlets
              >in web.xml
              >file.
              >
              >Thanking you
              >Very truly yours
              >Sriram (Ram) Peddibhotla, PhD
              >
              >
              >"Xiang Rao" <[email protected]> wrote:
              >>
              >>Check access.log to see the status of your image request (status code
              >>and response
              >>size). You can also check weblogic.log. On the other hand, IE cache
              >setup
              >>(e.g.,
              >>"Never") could cause this problem.
              >>
              >>"Sriram (Ra) Peddibhotla" <[email protected]> wrote:
              >>>
              >>>Dear friends
              >>>
              >>>How are you?
              >>>
              >>>I am developing Servlets in WebGain Studio Pro V4.1 VisualCafe
              >>>V4.1 to display dynamic HTML forms with embedded
              >>>images (*.jpg and *.gif).
              >>>
              >>>Please see the following sample code -
              >>>"<DIV ID=\"Logo\" STYLE=\"position:absolute; left: 4%; top: 4%;
              >>>width: 25%; height: 12%; z-index:1; visibility:visible\">" +
              >>>"<IMG SRC=\"FigLogo.gif\" WIDTH=\"100%\" HEIGHT=\"100%\">" +
              >>>"</DIV>"
              >>>
              >>>Then I deploymed servlets to BEA WLS 6.0 by including Servlets
              >>>in the Web.xml file. However, I do not see the images when
              >>>viewed in IE5.0 browser.
              >>>
              >>>I appreciate all comments and suggestions.
              >>>
              >>>Thanking you
              >>>Very truly yours
              >>>Sriram (Ram) Peddibhotla, PhD
              >>>          
              >>
              >
              

Maybe you are looking for