Jsp,java script and html

Friends I want to try something but I am totally lost on how to achieve it.Just to let u know that I have not worked in JAVASCRPT at all.And I am in great hurry to finish this work.
What I am looking for is after
1) a JSP page is thrown
2) a button is clicked
3)Moment the button is clicked I want a HTML file to be created (having all the info from the database) by using FileWriter class .After the HTML file is created and ready ,Then I want to open this HTML file in another window.
I know that to achieve this I have to use Javascript,but I am totally lost on how to do that.
I mean can I say in JAVASCRIPT that if this button is clicked then execute a java method which retrives data from the oracle database in the server and writes it to a HTML file and then after the writing is done,open it another window.
Please help.

Friends I want to try something but I am totally lost on how to achieve it.Just to let u know that I have not worked in JAVASCRPT at all.And I am in great hurry to finish this work.
What I am looking for is :
1) a JSP page is thrown
2) a button is clicked
3)Moment the button is clicked I want a file to be created with an extension HTML (having all the info from the database) by using FileWriter class .After the file is created and ready ,Then I want to open this file in another browser window.
I know that to achieve this I have to use Javascript,but I am totally lost on how to do that.
I mean can I say in JAVASCRIPT that if this button is clicked then execute a java method which retrives data from the oracle database in the server and writes it to a HTML file and then after the writing is done,open it another window.
Please help.

Similar Messages

  • How to create two level dynamic list using JSP , Java Script and Oracle

    I am new in JSP. And i am facing problem in creating two level dynamic list using JSP ,Java Script where the listdata will come from Oracle 10g express edition database. Is there any easy way in JSP that is available on in ASP.NET.
    Plz response with details.

    1) Learn JDBC API [http://java.sun.com/docs/books/tutorial/jdbc/index.html].
    2) Create DAO class which contains JDBC code and do all SQL queries and returns or takes ID's or DTO objects.
    3) Learn Servlet API [http://java.sun.com/javaee/5/docs/tutorial/doc/].
    4) Create Servlet class which calls the DAO class, gets the list of DTO's as result, puts it as a request attribute and forwards the request to a JSP page.
    5) Learn JSP and JSTL [http://java.sun.com/javaee/5/docs/tutorial/doc/]. Also learn HTML if you even don't know it.
    6) Create JSP page which uses the JSTL c:forEach tag to access the list of DTO's and iterate over it and prints a HTML list out.
    You don't need Javascript for this.

  • What're the differences between JSP, Java Script, and Java Applet?

    I am confused by the concepts: JSP (Java Server Page), Java Script, and Java Applet? What are their main differences?

    I don't know about differences, but one of their main similarities is that each of them has a page in Wikipedia.
    JSP
    JavaScript
    [Java applet|http://en.wikipedia.org/wiki/Java_applet]
    There. That should give you enough information.

  • Needed help on java script and html in PL/SQL doing nothing

    Hi,
    Created a procedure which takes username and password and changes OID, database password for that user with that password.
    I created a page in oracle portal and trying to call this below script package:
    BEGIN
    user_name := portal.wwctx_api.get_user;
    HTP.p
         <!-- BEGIN CODE FRAGMENT -->
         <script language="javascript">
         <!--
         function ValidatePass()
         var passStr = document.getElementByid("p_password").value;
         var confPassStr = document.getElementByid("Confirm_Password").value;
              var pattern = /[^a-zA-Z0-9]/;
              if (passStr == null || passStr == "") {
                   alert("Password value missing");
                   return;
              if (confPassStr == null || confPassStr == "") {
                   alert("Confirm password value missing");
                   return;
              if (passStr.match(pattern) == null && confPassStr.match(pattern) == null) {
                   if (passStr == confPassStr) {
                        document.form.submit();
                   } else {
                        alert("Your entries did not match. Please try again!");
              } else {
                   alert("Invalid charcters entered");
         //-->
         </script>
         <form name="changepassword"
         action="http://<hostname>:7777/pls/sys/sys.gx_user_mgt.globally_update_password"
              method="post" AutoComplete="Off">
    <input type="hidden" name="username" value=" '
    || user_name
    || ' " id="p_username"/>
    New Password:
    <input type="password" name="p_password" id="p_password">
    <br>
    <br>
    Confirm Password:
    <input type="password" name="Confirm_Password" id="Confirm_Password">
    <br>
    <br>
    <input style="padding:2px;" type="submit" value=Login onClick="ValidatePass();">
    </form>
    END;
    This gx_user_mgt.globally_update_password is the custom procedure I should call passing username and p_password
    Thanks in advance.

    Friends I want to try something but I am totally lost on how to achieve it.Just to let u know that I have not worked in JAVASCRPT at all.And I am in great hurry to finish this work.
    What I am looking for is :
    1) a JSP page is thrown
    2) a button is clicked
    3)Moment the button is clicked I want a file to be created with an extension HTML (having all the info from the database) by using FileWriter class .After the file is created and ready ,Then I want to open this file in another browser window.
    I know that to achieve this I have to use Javascript,but I am totally lost on how to do that.
    I mean can I say in JAVASCRIPT that if this button is clicked then execute a java method which retrives data from the oracle database in the server and writes it to a HTML file and then after the writing is done,open it another window.
    Please help.

  • Java Script and HTML

    Hi,
    i am creating a web page dynamically through ajax like this
    here i am creating a td element and appending a button element to it
    var td5= document.createElement("TD");
         td5.style.whiteSpace = "nowrap";
         td5.setAttribute("id", "button" + hostname);
         var button=document.createElement("input");
        button.setAttribute("type", "button");
        button.setAttribute("id", "updatebutton" + hostname);
        button.setAttribute("value", "Click here");
        button.setAttribute("onclick", "alert('OK')");
        td5.appendChild(button);it appearing good on web page the but when i click the button, where i am not getting supposed alert
       button.setAttribute("onclick", "alert('OK')"); line is not showing effect
    when i try like this
    button.onclick=new Function (alert('hi'));when my IE loads the page i am getting alert where as , alert must come after clicking the button
    any work around please
    Thanks
    R

    Friends I want to try something but I am totally lost on how to achieve it.Just to let u know that I have not worked in JAVASCRPT at all.And I am in great hurry to finish this work.
    What I am looking for is :
    1) a JSP page is thrown
    2) a button is clicked
    3)Moment the button is clicked I want a file to be created with an extension HTML (having all the info from the database) by using FileWriter class .After the file is created and ready ,Then I want to open this file in another browser window.
    I know that to achieve this I have to use Javascript,but I am totally lost on how to do that.
    I mean can I say in JAVASCRIPT that if this button is clicked then execute a java method which retrives data from the oracle database in the server and writes it to a HTML file and then after the writing is done,open it another window.
    Please help.

  • Problem  in merging java script and java code

    hi,
    i want to merge java and javascript code but it is giving some surprising results.
    this is my code:
    <script language = "javascript">
    <%
    String query_result= "1";
    String buttontype="";
    buttontype=(String)session.getAttribute("buttontype");
    query_result = (String) session.getAttribute("query_result");
    out.println(query_result);
    if(buttontype!=null&&(buttontype.equals("submit")))
    out.println(buttontype);
    %>
    alert(<%=ka%>)
    </script>
    <%
    %>
    now if i'll move "<script language = "javascript">" to:
    <%
    String query_result= "1";
    String buttontype="";
    buttontype=(String)session.getAttribute("buttontype");
    query_result = (String) session.getAttribute("query_result");
    out.println(query_result);*/
    if(buttontype!=null&&(buttontype.equals("submit")))
    out.println(buttontype);
    %>
    <script language = "javascript">
    alert(<%=query_result%>)
    </script>
    <%
    %>
    then it prints correctly and gives alert "1" but if i'll change query_result="manish" then it is not giving alert also
    i don't know wht is happening
    plz help me out
    manish

    hi pgeuen,
    Thanx for ur reply
    now its working i have changed my jsp exp. tag to
    alert("\"<%=ka%>\"")
    and it is displaying correctly.
    and if i'll give the scripting tags in "if block"then it will work but till now i didn't get why i was not getting any output when the scripting tags covers the whole jsp code. i think we can mix java script and jsp in any way.
    well thanx a lot.
    manish

  • What is java script and how do I enable it?

    What is java script and how do I enable it

    JavaScript is enabled by default for Adobe Reader for iOS, and I don't see that there's a way to disable it. It is currently used within a document to control the behavior of form fields, such as automatic formatting and calculations. Only a small subset of what's available in the desktop version is available in the mobile versions.

  • Java script and scriplets

    Hi,
    I have got a .jsp page wherein there is a 2 dimentional string array defined within a scriplet.
    I have defined an other function in java script within the same page.
    Now I need to access the string array within the java script. Can someone please hep me how to achive this...
    I tried something like this, but its not working:
    function displayNameIndex()
    var source = <%= imgArrayName %>[0][0];
    where imgArrayName is the name of the String array in the scriplet code.
    Many thanks

    JSP is executed at the serverside and generates a long HTML string. Javascript is part of this HTML string. Once this string is arrived at the client, the JS will/can be executed.
    What you're expecting here is that the Javascript is able to access the Java Object which is converted into a simple plain vanilla string. That is not true. Better is to put all of this logic in the server side or in the client side. You may need to iterate through the Java String[][] object and print all values into the response, so that JS can access them.

  • Page failure when attempting to save java script in html header

    Currently there is java script code for a function that is seeded in the html header of a forms page by apex when the form is generated. This code is for the chicken test for the DELETE button.
    The function works as designed, but if I try to "APPLY CHANGES" to the the page definition I get the The page cannot be displayed "Cannot find server or DNS Error". "the url is http://nldg-3.appl.devjones.com:7777/pls/apex/wwv_flow.accept" If I remove the script coding from the HTML header the page will save just fine, but of course no more java script.
    I need to add a java script function to the page and I am unable to do so at this time because of this issue. I can reproduce this error on any of the sample apps that I have loaded into apex.
    the Apache error log contains:
    [Fri Feb 13 06:11:06 2009] [error] [client 172.16.85.122] [ecid: 1234527066:192.168.211.127:31922:0:17188,0] mod_plsql: /pls/apex/wwv_flow.accept HTTP-500 Error Reading Data from Client!!
    The Apache access gets:
    172.16.85.122 - APEX_PUBLIC_USER [13/Feb/2009:06:23:47 -0600] "POST /pls/apex/wwv_flow.accept HTTP/1.1" 500 653
    Apex is version 3.1.2.00.02 and uses on iAS on a Linux server. The Database is 10g. The browser is IE 6.0.2900.2180.
    I have been developing for about 3 months in Apex and this is the first issue of this kind that I have run into. Any help will be greatly appreciated as I have no clue at this time.

    Luis,
    All the forms are created by Apex with a default function in the html header for a delete chicken test as follows:
    <scrpt language="JavaScript" type="text/javascript">
    <!--
    htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    //-->
    Even though the function is already a part of the page, if I try to save it, it will fail. I will look into the "black list" a little deeper. I have asked around abit as I also had suspected that, but so far all the answers were that it should not be a problem. If I take out the "SCRIPT" word I can get the page to save, but of course the code is worthless at that point.
    Keith

  • Java script and Servlets

    Any body can give a sample program how can i included a java script in a servlet program
    Regards
    Marimuthu

    What exactly are you trying to achieve?
    This is a typical servlet with raw html. You can also put javascript there the same way html is there.
    public class FirstServlet extends HttpServlet {
      public void doGet(HttpServletRequest request,
        HttpServletResponse response) throws ServletException,
          java.io.IOException {
        //set the MIME type of the response, "text/html"
        response.setContentType("text/html");
        //use a PrintWriter to send text data to the client who has requested the
        //servlet
        java.io.PrintWriter out = response.getWriter( );
        //Begin assembling the HTML content
        out.println("<html><head>");
        out.println("<script language='javascript'>alert('Hello Muthu');</script");
        out.println("<title>Help Page</title></head><body>");
        out.println("<h2>Please submit your information</h2>");
       //make sure method="post" so that the servlet service method
       //calls doPost in the response to this form submit
        out.println(
            "<form method=\"post\" action =\"" + request.getContextPath( ) +
                "/firstservlet\" >");
        out.println("<table border=\"0\"><tr><td valign=\"top\">");
        out.println("Your first name: </td>  <td valign=\"top\">");
        out.println("<input type=\"text\" name=\"firstname\" size=\"20\">");
        out.println("</td></tr><tr><td valign=\"top\">");
        out.println("Your last name: </td>  <td valign=\"top\">");
        out.println("<input type=\"text\" name=\"lastname\" size=\"20\">");
        out.println("</td></tr><tr><td valign=\"top\">");
        out.println("Your email: </td>  <td valign=\"top\">");
        out.println("<input type=\"text\" name=\"email\" size=\"20\">");
        out.println("</td></tr><tr><td valign=\"top\">");
        out.println("<input type=\"submit\" value=\"Submit Info\"></td></tr>");
        out.println("</table></form>");
        out.println("</body></html>");
        }//doGet
      public void doPost(HttpServletRequest request,
        HttpServletResponse response) throws ServletException,
        java.io.IOException {
        //display the parameter names and values
        Enumeration paramNames = request.getParameterNames( );
        String parName;//this will hold the name of the parameter
        boolean emptyEnum = false;
        if (! paramNames.hasMoreElements( ))
            emptyEnum = true;
        //set the MIME type of the response, "text/html"
        response.setContentType("text/html");
        //use a PrintWriter to send text data to the client
        java.io.PrintWriter out = response.getWriter( );
        //Begin assembling the HTML content
        out.println("<html><head>");
        out.println("<title>Submitted Parameters</title></head><body>");
        if (emptyEnum){
            out.println(
               "<h2>Sorry, the request does not contain any parameters</h2>");
        } else {
        out.println(
            "<h2>Here are the submitted parameter values</h2>");
        while(paramNames.hasMoreElements( )){
            parName = (String) paramNames.nextElement( );
            out.println(
                "<strong>" + parName + "</strong> : " +
                    request.getParameter(parName));
            out.println("<br />");
        }//while
        out.println("</body></html>");
      }// doPost
    }

  • Java(script) and WD4A

    Hi all,
    I know you can't use any javascript in WD yourself, but after creating a WD component / application, the code that is generated, does it contain, beside HTML code any java(script) or some other kind of scripting?
    If so, what kind of scripting should I think of and what does it do?
    Kind regards,
    Micky.

    >
    Micky Oestreich wrote:
    > Thanks for the quick reply (even on a sunday). Just for my understanding: The fact that you cannot enter your own javascript like in BSP, lies in the fact that SAP wants to make WD platform independent, correct me if I'm wrong? So how does SAP ensure this by using javascripting when generating the WD webpages? Doesn't this make it platform dependant?
    We aren't just shooting for independence between browsers (IE vs. Firefox) but entire clients.  In Web Dynpro you will soon be able to run the same application in a Browser or the Flex Client or the NetWeaver Business Client without changing anything in your application - the later two don't even use JavaScript or HTML.
    Now how do we ensure cross-browser support in JavaScript - well nothing really special there.  Sometimes it takes separate JavaScript libraries and sometimes it just takes branching logic within a JavaScript function.  Most of the differences between the browsers are pretty well documented and although a pain to deal with not really that much of an unknown.  Still better to let one small group of UI foundation developers have to deal with than all the thousands of application developers.

  • Java Script and JSF question

    Hello,
    I have a JSF component like this that has a pageSize attribute. It shows a grid with 5 elements.
    <x:gridView id="#{tab}GridView" pageSize="5">
    </f:gridView>Then I have a drop down with 5 menu items where the user can select how many elements they want to see visible on the grid. My question is, how do i use Java Script to to change the pageSize attribute above with what the user selected in the menu below? I have been looking at java script code and online docs for an hour and cant come up with anything that seems to work. Any help will be appriciated. Thank you!!!
    <x:selectOneMenu id="myMenu" onclick="">
      <f:selectItem id="perPage1" itemValue="1" itemLabel="1" />
      <f:selectItem id="perPage2" itemValue="2" itemLabel="2" />
      <f:selectItem id="perPage3" itemValue="3" itemLabel="3" />
      <f:selectItem id="perPage4" itemValue="4" itemLabel="4" />
      <f:selectItem id="perPage5" itemValue="5" itemLabel="5" />
    </x:selectOneMenu>

    [...]how it was never designed to be used for
    such large applications[...]All I can say is that if this is true, then it doesn't show. Yes, I know it (oak) was originally designed for embedded systems, but Java and Oak aren't identical.
    My assembly teacher
    always makes fun of Java, saying java gives you far
    less control, it prevents you from making mistakes.
    No control over unsigned/ signed values, pointers
    etc. Yes. But broadly speaking that's the point. Java sacrifices control over such things. The return, however, is that programmers are able to be more productive because of the great swathes of problems that can no longer arise.
    The mistake is in assuming that Java is the best tool for everything. It isn't, and in fact no language us. As it turns out, Java is just great for building enterprise systems. It has a few other strengths, some of which (applets for example) have been more important in its original uptake but are now relatively minor features.
    You don't write an enterprise website in Intel assembly, and you don't write device drivers in Java.
    Not saying its not good but its good for
    smaller applications like cell phones and
    mini-computers.I think you mean something different by mini-computers to what I mean...
    Its portability is actually the main point in its favour for use in cell phones. If it weren't for that, I think C or C++ would probably have sole ownership of that space.
    Now i'm not saying any thing against it just
    confused on why a class like data-structures at my
    University [...] would be taught using java when C would
    probably be a lot better for Very Large ADTS.You and Joel Spolsky:
    http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html
    I disagree, because I don't think it much matters what language you learn - experience trumps any particular initial language choice. If you're still using Java in 15 years I'll be fairly surprised.

  • Can a Button call a java script and then proceed with the creation

    Hi all,
    I have a simple APEX form on a table,
    with simple function as create and apply changes,
    some items of the form are computed by a "Computation"
    I need the create button to show the computed values, before move to the next page, then proceed with the creation ( submission)
    I have tried to show the values by a java script, but after clicking the button OK of the javascript msg, no submission performed ,
    details:
    the java script is called in the URL of the Button,
    it only contains a alert statement
    is there a way to let the button do that
    or may be the case could be solved by another idea!!!
    rgrds,

    Hi Varad,
    It is Before header of course. I forgot to mention this.
    Yes, you are right Varad, I have read again the question and seems original request was to show Computation that is done in After Submit, more javascript is required of course.
    One possibility is to create On Demand process called COMPUTEITEM where you compute your item, and in the end of on demand process it prints it
    htp.p(:P1_X)
    Then put in HTML header of your page
    <script language="JavaScript" type="text/javascript">
    function setShowItemSub(pThis){
       var l_This   = $x(pThis);
       var ajaxRequest = new htmldb_Get(null, $v('pFlowId'),  'APPLICATION_PROCESS=COMPUTEITEM', $v('pFlowStepId'));
       ajaxRequest.add($x(l_This).id, $v(l_This));
       var gReturn = ajaxRequest.get();
       alert(gReturn);
       ajaxRequest = null;
      doSubmit('aa');
    </script>And in Button URL textarea put:
    javascript:setShowItemSub('P1_X');
    Then no need in After Submit process anymore
    I have put this now in http://apex6.revion.com/pls/apex/f?p=225:1
    COMPUTEITEM On demand process is :
    :P1_X := :P1_X || ' Added this trail';
    htp.p(:P1_X);Of course, all this should be modified accordingly
    Regards,
    Oleg

  • Java script and password request

    Hi, this is my husband's play book and he is having a couple of problelms with it at the moment..
    1.First:
    When he tries to load a paticular app, he gets a  java script error "null" message..I loaded the same app on my phone (Galaxy S III) and it worked fine but it doesn't on my DH's or my DIL's BB Playbook..
    2. Password Request:
    While reading his ebooks,BB playbook keeps asking for him to supply his password again..he "save"s it each tie and then it asks him again a few minutes later..same happens if he selects "cancel" 

    which means??
    so who's problem is it that it doesn't work?? Blackberry or The Citizen Developer?? this only started all of a sudden..up till just recently, there was no problem with this app..and deleting it and reinstalling it doesn't help..

  • Java script and the new and not improved firefox don't work. Please let me be able to run Java again.

    I use SAP Infoview for work. To modify reports it requires a Java script to run. I had it set up in the previous version of ff to always allow from this specific site and it worked wonderfully. Now, in the new version, despite following all of the instructions from others, I cannot do my work because I cannot run Java script. I can still run it in Safari, but Safari is a last resort for me to use. I prefer Firefox and have all of my links stored there.

    Some sites are not fully compatible with Firefox 4's new HTML5 rendering engine. Can you turn that off and test without it? Here are the steps:
    (1) Open a new tab, then type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (2) In the filter box, type or paste '''html5''' and pause while the list is filtered
    (3) Double-click '''html5.parser.enable''' to toggle it to false (it should turn bold).
    Then change back to the SAP tab and reload the page.
    Does that make any difference?

Maybe you are looking for

  • Process for Debugging BW Start Routines

    I need a detailed process for how to debug the ABAP code of a start routine, particuarly when one ODS is being loaded into another.  I know that there is a way to do this with the ABAP debugger but cannot figure it out. Are there any documents out th

  • Unable to create attribute dimension in Essbase Studio

    Hi All, As per the process,I am create an Attribute for an dimension as below Hierarchy Family(gen1) SKU(gen2) Attribute1(gen1) SKU(gen2) Attribute2(gen2) SKU(gen3) Here the issue i am unable to create an 2nd attribute parallel to first on i mean att

  • Second Patch for Oracle Dev. 6.0

    Where is the second Patch for Oracle Developer 6.0. It was announced for the end of the last week. Gnter null

  • Remote panels - Client Crashes Situation

    Hello, I would like to ask if someone can help me with the following situation. I have an application which contains a top level VI and several other dialog VIs. This application can be accessed by a remote client via Remote Panels. From the top leve

  • A Warning about malformed URI

    I got this warning after running some code through HTML Tidy. Can anyone tell me what it means. The page validates ok but I would still like to know if this is something I need to fix. Thanks Martin