HTML form and java

Hi,
I have been pulling my hair out for the past week on this with no suces EVEN after forum searching, googling ..........
Here is the problem:
I have an HTML form of the following type and need to pass in a Javascript variable to the servlet called on hitting the submit button.
<script>document.write('<form name="Test" method="get" onSubmit="return chkfields(this)" action="/servlet/NewServlet?ABC='+unescape(params["ABC"])+'">')</script>For debugging purposes, I have a document.write statement and I see it on the page right above that line and it does display it on the field. However this thing does not pass the varible to the servlet. I even tried replacing the unescape(params["ABC"]) with just the variable name used in the form as ABC and that did nto work either. Please suggest any other suggestions.

test.html:
<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<script language="JavaScript">
function setHidden() {
  document.testForm.testInput.value = "test";
  return true;
</script>
</head>
<body>
<form method="post" name="testForm" action="test2.jsp" onSubmit="return setHidden()">
<INPUT TYPE="hidden" NAME="testInput">
<INPUT TYPE="submit" VALUE="submit">
</form>
</body>
</html>test2.jsp:
<html>
</head>
<body>
<%
out.println(request.getParameter("testInput"));
%>
</body>
</html>

Similar Messages

  • HTML forms and tables w/Oracle

    Hi,
    New to Oracle - used AMP before.
    My new organization does not use any open source so PHP is out. I assume I could use .net or java instead to DB query from HTML forms and render DB results to HTML tables.
    But besides .net and java are there any other languages that work well with Oracle for this purpose?
    Thanks,
    Lee G.

    hi,
    you can use the pl/sql web tool kit to develop web applications

  • Images in HTML forms and/or reports

    Hi,
    Apologies if a stupid question, but can you display a combination of data and image content in Portal HTML forms and/or reports? If so, how?
    This question assumes that the image in question is browser-supported (e.g. gif file), and the link to it is in the same database table as the data being reported (as a bfile data type).
    Alternatively, what if the image was actually directly stored in the database table as a BLOB data type?
    Help!
    Cheers, Jeff

    Hi Sharmila,
    Thanks for the info!
    Would this also work if the image wasn't a blob, but instead just stored on the filesystem (as a gif file), with the reference to it stored in the database as a bfile datatype?
    Thanks once again, Jeff
    Hi,
    You can build portal forms to upload images. You can use blob columns here. You can also have images in a report. This will be the SQL to query data from tables having intermedia data.
    Select a.empno,a.ename,a.mgr,a.sal,
    portal30.wwv_user_utilities.get_intermedia('EMP','EMP_AUDIO','AUDIO',a.rowid)
    the_audio, b.dname,b.loc,
    portal30.wwv_user_utilities.get_intermedia('DEPT','DEPT_PICTURE','IMAGE',b.rowid) the_picture
    from emp a, dept b
    where a.deptno = b.deptno
    The table should have the ordimage column type.
    Thanks,
    Sharmila

  • HTML Forms and Procedures

    Hello!
    We are trying out APEX for the first time. We would like to keep our business data objects in a different schema from the APEX schema. I have been able to successfuly create a proc and create a form over the proc in the differenet schema.
    I'm wondering if we can create HTML forms and later reference the procedure. The goal is to have the Database Developers create the procs while the developers create the forms at their own pace, then later wire that form to the proc. I hope this makes sense!!
    Thx!

    I resolved this on my own. Pretty simple, just new at this.

  • WebEnterprise - HTML Editors and Java

    I'd like to know any opinions on HTML editors and their use with
    WebEnterprise. Have any of you done
    evaluations to determine the best editor to use with the Forte product? Also,
    do you have experience using
    a Java applet as the front-end to a Forte service object? In this instance,
    are you able to do so with Forte 30f2 and
    WebSDK?
    Thanks,
    Peggy Adrian
    Eli Lilly and Company

    Peggy,
    FrontPage 97 / 98 have both worked really well for us, however we
    discovered a slight hitch with 98 where the Editor would gobble up
    <?FORTE ..> tags inside the SELECT OPTION tag, but you can work around
    that one, apart from this FP98 is a great HTML editor. I also thought
    HotMetal was a good fit.These observations come out of evaluating about
    5-6 leading HTML editors.
    Some recommended steps in the process:
    1) Create a prototype by laying out all the HTML using an Editor. Figure
    out all the navigation within your web. More recent features seen in
    HTML editors such as JavaScript generation and DHTML / CSS support are
    really difficult to work out on your own, let the advanced Editors do as
    much dirty work for you as poss.
    2) Once the prototype is finalized, for all the pages requiring any
    dynamic content generation, figure out all the Tag Handlers you will
    need. Change the HTML Content by inserting the FORTE tags as required,
    code the corresponding Handlers.
    3) Figure out the relation between page requests and the security
    requirements for your pages, design the Session properties and data
    tracing across requests using the Session object.
    4) Do refer to all the Tech Notes on the Forte web site for known
    issues.
    As for the Java applets frontend, we have used Java - IIOP - Forte since
    early beta through every Forte release (3.0.X) and it works fine with
    WebEnterprise and release 30f2.
    - Sameer
    From: Peggy Lynn Adrian <[email protected]>
    Date: Wed, 07 Jan 1998 15:19:58 -0500
    Subject: WebEnterprise - HTML Editors and Java
    I'd like to know any opinions on HTML editors and their use with
    WebEnterprise. Have any of you done
    evaluations to determine the best editor to use with the Forte
    product? Also,
    do you have experience using
    a Java applet as the front-end to a Forte service object? In this
    instance,
    are you able to do so with Forte 30f2 and
    WebSDK?
    Thanks,
    Peggy Adrian
    Eli Lilly and Company

  • How to submit a html form using java

    hi friends,
    i have a html form with some input fields, when ever a user submit the form the user information is stored in the database. is it possible to pass the user information in the url(url rewriting) and submit it by a java program so that the data will be stored in the database, as like as, user submit it manually.
    for eg:
    /*sample.html*/
    <form action="store.jsp" method="post">
    User Data:<input type="text" name="userdata">
    <input type="submit">
    </form>
    in my java is it possible to store the record as below:
    URL url=new URL("http://localhost:7001/webapp/store.jsp?userdata=AutomaticDatasave");
    URLConnection con=url.openConnection();
    int i=0;
    while((i=con.getInputStream().read())!=-1)
    System.out.print(i);/*it has to print the data that store.jsp is returned like information stored or error storing data(what ever)*/
    }Edited by: rajaram on Oct 27, 2007 1:01 AM

    hi Drclap,
    Thanks for your reply, which is helpful to me....
    tried what you said, what i did is modified the code like below
    con.setDoOutput(true);
    BufferedWriter br=new BufferedWriter(new InputStreamWriter(con.getOutputStream()));
    String str="userdata=AutomateDataSave\n";
    br.write(str,0,str.length());
    br.flush()But
    Iam Getting Internal Server Error
    Exception in thread "main" java.io.IOException: Server returned HTTP response code: 500 for URL
    Edited by: rajaram on Oct 27, 2007 1:24 AM

  • Is it possible to mimic a submission of html form in Java Swing

    Helppp!!!!
    I want to create a swing applet (The plugins are installed) that would submit to a servlet. The servlet is having a doPost method. Now How do I form fields (that is textfield, hidden field) in a swing environment.
    The same attempt if made in a normal HTML document, I get the results.
    But how to do it swing environment.
    I have seen classes called FormView, HTMLDocument etc in javax.swing.text.html package. The documentation also says that a input type=button will be intrepreted as JButton. There is also a method called as "submitData()" in the FormView class.
    But how actually do you use it.
    Or is there any other way.
    Can anyone help me out please?
    Thank you
    MrWrongBoy

    You could simply let the JTextPane load up an HTML page with a form for you which in turn you can fill out and submit to your servlet. And here is my working sample:
    public class HTMLFormJApplet extends javax.swing.JApplet {
        public void init() {
            initComponents();
            htmlPane.setEditable(false);
            String page_name = getParameter("page_name");
            try
                htmlPane.setPage(new java.net.URL(getDocumentBase(),page_name).toExternalForm());
            catch(Exception e)
                e.printStackTrace();
        private void initComponents() {
            jScrollPane1 = new javax.swing.JScrollPane();
            htmlPane = new javax.swing.JTextPane();
            jScrollPane1.setViewportView(htmlPane);
            getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTextPane htmlPane;
    --------------- HTMLFormJApplet.html -------------------
    <applet codebase="." code="HTMLFormJApplet.class" width="350" height="350">
    <param name="page_name" value="testform.html">
    </applet>
    --------------- testform.html --------------------------
    <form method="POST" action="myservlet">
    <font color="green">First Name:</font><input type="TEXT" value="firstname" value="wally"><br>
    <input type="SUBMIT" value="Submit">
    </form>

  • Converting html forms to java

    having viewed an earlier post in this forum i managed to create the following code but am having a few problems.
    here are the active parts of the html form on googles search, engine. i am trying to convert this into java form and have so far succeeeded in generating the code shown below, but keep getting the following error
    "IOException; Server returned HTTP response code: 501 for URL: http://www.google.co.uk/search"
    the form:
    <form action=/search name=f>
    <input type=hidden name=hl value=en>
    <input maxlength=2048 size=55 name=q value="" title = "Google Search">
    <input type=submit value="Google Search" name=btnG>
    <input type=submit value="I'm Feeling Lucky" name=btnI>
    </form>
    in the following code baseURL is the domain of the server... in this case http://www.google.co.uk/, method is the method as defined in the form method attirbute, if the attribute is not there, as in this form the default method is called which is GET
                URL url;
                HttpURLConnection urlConn;
                DataOutputStream printout;
                BufferedReader input;
                if(action.startsWith("http")) {
                    url = new URL(action);
                } else if(action.startsWith("/")) {
                    url = new URL(baseURL+action.substring(1,action.length()));
                } else {
                    url = new URL(baseURL+action);
                urlConn = (HttpURLConnection) url.openConnection();
                urlConn.setDoInput(true);
                urlConn.setDoOutput(true);
                urlConn.setUseCaches(false);
                //      set request method
                urlConn.setRequestMethod(method);
                //      set request type
                urlConn.setRequestProperty("Content-Type",
                        "application/x-www-form-urlencoded");
                //       data-value pairs are separated by &
                String content ="hl=en&q="
                // imitate someone searching for "hello" in i feel lucky
                content+="hello&btnI=I'm Feeling Lucky";
                urlConn.setRequestProperty("Content-Length", content.length() + "");
                //       Send POST output.
                printout = new DataOutputStream(urlConn.getOutputStream());
                printout.writeBytes(content);
                printout.flush();
                printout.close();
                //       Get response data.
                input = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
                String str;
                while (null != ((str = input.readLine())))
                    System.out.println(str);
                input.close();
            } catch (MalformedURLException me) {
                System.err.println("MalformedURLException; " + me);
            } catch (IOException ioe) {
                System.err.println("IOException; " + ioe.getMessage());
                ioe.printStackTrace();
            }i also tried self adding in the question mark that appears after the search text bu again get the same error. any ideas what im doing wrong when connecting to the server? thanks in advance for any help

    Just saw this topic on the forum,
    For each web crawlers the web sites maintain a file called Robots.txt which can be assessed by : http://www.google.co.uk/robots.txt
    You would see following on that file :
    User-agent: *
    Allow: /searchhistory/
    Disallow: /search
    Disallow: /groups
    which means that crawlers are not allowed to scrap this site on search, due to which our code wasnt working
    Thanks

  • Forms and Java 7

    Hi Forum. I know that there is no version of Forms certified with Java 7, the last post of Michael Ferrant in this thread is very clear: Forms 10g and Java 7 (1.7) problems (lamentably the thread is locked)
    On the other side, the Oracle Java SE Support Roadmap (Updated September 19, 2012) states that the End of Public Updates of Java 6 is Feb 2013... but Oracle now owns Java, so it is not really "the other side"
    My point is that the gap is adjusted and closing... If we use Forms we can not upgrade to Java 7 ... but in three months, maybe we NEED to move to Java 7 because there will be the only way to be actualized with security updates
    Anybody knows what is the official position of Oracle in this matter ?
    Thanks in advance
    Alfonso

    As Francois mentioned, Forms 11.1.1.6 is now supported with Java 7. We are also hoping that an upcoming version of 11.1.2.x will also support Java 7. Hopefully details will be released soon.
    As for the desupport of Java 6, as long as you are using an Oracle product which has a dependency on any particular java version and that product is still entitled to support, the dependant java version will also remain supported in that case. In other words, because FMw (PFRD) 11.1.1 will be supported until sometime in 2014, we will continue to support the use of Java 6 if and only if it is used in conjunction with that specific FMw release for as long as the FMw release remains in support.
    The dates for desupport of Java apply to end-users not using it in conjunction with other Oracle products.
    Refer to these MyOracleSupport notes for more details: 952075.1 & 1470123.1
    Because date and policies mentioned in this and other forums or blogs are subject to change at any time, it is always a good idea to refer to the official product documentation or contact Oracle Support if you have any concerns or questions. They can provide you with the latest information.

  • Forms and Java

    Hello,
    I have written a Java program that I want to call from a forms program. My form is written in the latest version of Oracle Forms Builder. My logic in the Java class is a common functionality that I want to use in many forms in my application. This functionality is written in Java because PL/SQL does not have functionality for that logic.
    By the way, I have an additional question regarding PL/SQL and Java classes. Suppose I want to write common functionality that accesses my database with SQL statement. Which technology is best for performance? Is it Java or PL/SQL? My guess is PL/SQL?!

    I have now found the FORMS90_BUILDER_CLASSPATH in the registry. I have added my Jar file at the end of the FORMS90_BUILDER_CLASSPATH like this;
    C:\OraHome_1\forms90\java\javacode.jar. Then I restarted my computer.
    My javacode listed in the jar file is not available in the import java dialog in forms builder. Is there something else I should do? The only thing that I have done is the changes on the FORMS90_BUILDER_CLASSPATH. Maybe it is something in my Java code? My Jave code is an common Java class with only standard Java import statements.

  • Generated Forms and Java Components

    I have seen many threads about enhancing forms with Java - including webutils.
    Our application is mostly generated from Designer (near 100%) and I was wondering how to include these java calls in the repository - which may well mean this is the wrong forum!!
    Basically if the code is enhanced with these java calls can it be entered in the repository for regeneration?

    Jon,
    good question. As far as I know Designer does not store Java code in its repository. However, the Java code alsways is held outside of Forms in a jar file which means that if you can set the implementation for an item class in Designer or add a Bean Continer to a canvas, you can use it with Designer. I am passing this question forward to somebody who know it better than me.
    Frank

  • Web-enabled forms and Java

    We are developing a custom application using Developer 6. The application is web enabled
    using Oracle Application Server 4.0.7 and Developer Server on a Solaris 2.6. This application is an extranet for company use only.
    The problem that requires the use of Java is that we cannot read the client registry using web enabled forms. The solution I am told is to use Java to read the registry. Has anyone done such a thing? Can anyone provide suggestions or guidelines?
    Thanks for any help you can offer!

    do the following:
    1. write a java program that read from the registry. you will use the program as a javabean later on.
    2. compile the source and create a class/jar
    3. sign it (goto sun site for details on signing class/jars). you must sign the java program or it will not be able to have access to the registry. make sure you do all the steps by following sun's instructions.
    4. put it on your web server and modify the html file you use to start your developer application to include your class/jar.
    5. oracle has some demos on attaching javabeans to forms. use them to help you.
    6. use the program you wrote in step 1 as a javabean in your forms.
    Yossi

  • HTML applet and JAVA command

    hi,
    i have a problem that i can not solve....
    i can execute my code in typing javac Myclass.java
    and then i type java Myclass
    then my game is running very well.
    but when i put all my classes in a HTML page it does not work.
    I see my class being charged in the java virtual machine but it stops and i can not have the render of my game.
    could someone explain me why?

    Have you checked the Java-Console of your Browser? May be there are Exceptions which help you to find out the reason...

  • GME PLLs, forms and java class files???

    Hi,
    if we generate forms of GME from adadmin PLLs will also get generated but how to compile java class files of a product GME ?
    simply we need to create jar files?
    Regards

    Hi,
    if we generate forms of GME from adadmin PLLs will also get generated but how to compile java class files of a product GME ?No.
    simply we need to create jar files?What do you mean by "create jar files"? Do you want to compile java classes? If yes, then the correct syntax is as follows:
    SQL> ALTER JAVA CLASS "Object Name" RESOLVE;Regards,
    Hussein

  • Struts html:button and java script problem

    Given code gives an error "equal symbol expected" what may be the error
    <html:button property="back1"
                   onclick="forwardToPreviousPage('<%=(String)session.getAttribute("projectId")%>')">Back</html:button>

    Try changing onclick to onClick and try...
    regards
    shanu

Maybe you are looking for

  • Windows 7 ultimate task manager can not open file location

    hi, I just re-installed the Windows 7 Ultimate on my laptop several weeks ago, everything goes well until I find this error. When I open Task Manger and right click one process, then an error occurs when I click "Open File Location". It shows as "tas

  • Port forwarding no longer working

    i recently moved in with my boyfriend and he has fios and before i moved in we played minecraft on a server he hosted and after like a weekof hosting it, his portforwarding no longer worked. after going threw every thing we could find we gave up. and

  • HT204387 connect ipod to blackberry via bluetooth

    can anybody help me, how to connect ipod touch 5th to blackberry ? i tried to connect it but the message show "bluetooth not supported".

  • Corrupt File Names on NAS

    I have 4 networked G4s running variously 10.4.6 to 10.4.10. Also on the network is an Iomega NAS. When viewed from 2 of the G4s all the file names on the NAS are normal whereas from the other two some of the file names are corrupt. Setting up a new u

  • Web page video - what file type would you recommend?

    I've stood up a web page for selling things (house, musical instrument, chipper-shredder, rent an apartment, etc.) and would like to have a few videos included. The plan is to save the video on the server and not use hyperlinks to places like vimeo a