HTML Form in a "PL/SQL (anonymour Block)"

Hello
I need a little ugent guidance
I have create a "form" within a "PL/SQL (anonymour Block)". The requirement is to show what a HTML form looks like as you build the code
The problem is I am "Up Setting" the APEX processing i.e. wwv_flow.accept ... I have added an example below .....
All help very welcome
Thanks
Pete
htp.prn('<!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">');
htp.prn( '<style type="text/css">');
htp.prn('#form{font-family: "Trebuchet MS", Verdana, sans-serif; width:25em;}');
htp.prn('h2{margin: 0 0 0 0; padding: 0;}');
htp.prn('p{margin: 0 0 1em 0; padding: 0; font-size:90%}');
htp.prn('fieldset{background:#C361D2; border:none; margin-bottom:1em; width:24em; padding-top:1.5em}');
htp.prn('p.legend{background:#DED983;
color:black;
padding: .2em .3em;
width:750px;
font-size:18px;
border:6px outset #DED980;
position:relative;
margin: -2em 0 1em 1em;
width: 20em;}');
htp.prn('fieldset{margin-bottom:1em; width:66em; padding-top:1.5em;}');
htp.prn('#company {background:#F3B4F5; border:outset #F3B4F5; width="700";}');
htp.prn('#company label{position:absolute;
font-family:arial;
font-size:16px;
padding:.2em;}');
htp.prn('input{margin-left:9em;margin-bottom:.2em; line-height:1.4em;}');
htp.prn('#message1 {background:#a3B4F5; border:outset #a3B4F5; width="700";}');
htp.prn('#message2 {background:#c3B4F5; border:outset #c3B4F5; width="700";}');
htp.prn('button1 {font:48px "Trebuchet MS", "Verdana", sans-serif;
                 background:#F0888A;
                 border:outset #6EC6F1}');
htp.prn('#buttons1 input {background:#DED983;
font:1.2em "Trebuchet MS", Verdana, sans-serif}');
htp.prn('p#buttons1 {white-space:nowrap}');
htp.prn('</style>');
htp.prn('<table width="760"><tr bgcolor="#D5EAE9">');
htp.prn('<BR><BR>');
htp.prn ('<form method="" action="">');
htp.prn ('<fieldset id="company"><p class="legend" >Company</p>');
htp.prn ('<label>Comapany Name: </label> <input name="company" type="Text" size="30"/>');
htp.prn ('<br><br>');
htp.prn ('</fieldset>');
htp.prn ('<br><br><br>');
htp.prn ('<fieldset id="message1"><p class="legend">Message One</p>');
htp.prn ('</fieldset>');
htp.prn ('<br><br><br>');
htp.prn ('<fieldset id="message2"><p class="legend">Message Two</p>');
htp.prn ('</fieldset>');
htp.prn ('<br><br>');
htp.prn ('</form>');
htp.prn('</tr></table>');
End;
______________________________________________________________________________________________________

Pete:
Remove the name attributes from all input elements defined by the pl/sql process. For example
<input name="company" type="Text" size="30"/> should be replaced by <input type="Text" size="30"/> or <input name="f01" type="Text" size="30"/>
The APEX accept process recognises a predefined set of HTML form input names. Any input with a name not from this set will cause the accept process to fail. f01 through f50 are valid names for the accept procedure.
varad

Similar Messages

  • HTML not working in PL/SQL block..Help me ASAP

    declare
    l_col VARCHAR2(30) :=to_number(to_char(to_date('01-feb-2011','dd-mon-yyyy'),'dd'));
    CURSOR name_cur IS
      select name
          from   od_shift_schedule
          where   year=2011
          and    (month)=('Feb')
           and    decode(l_col,1,"01",2,"02",3,"03",4,"04",5,"05",6,"06",7,
                         "07",8,"08",9,"09",10,"10",11,"11",12,"12",13,"13",14,"14",15,"15",16,"16",17,"17",18,"18",19,"19",20,"20",
                         21,"21",22,"22",23,"23",24,"24",25,"25",26,"26",
                       27,"27",28,"28",29,"29",30,"30",31,"31")='W';
    BEGIN
      DELETE FROM nam;
      commit;
      FOR i IN name_cur
      LOOP
      dbms_output.put_line(i.name);
      htp.p('<b>Employee '||i.name||'  has been ticked.
       </b><br/>');
      EXECUTE IMMEDIATE 'insert into nam(name) values('''||i.name||''')';
      commit;
    END LOOP;
    end;Kindly help me with this
    If i'm wrong here kindly help me that how can i place a display message

    Re: HTML not working in PL/SQL block..Help me ASAP
    Using the community discussion forums for urgent issues is rude and a violation of the terms and conditions.
    http://www.oracle.com/html/terms.html
    >
    4. Use of Community Services
    Community Services are provided as a convenience to users and Oracle is not obligated to provide any technical support for, or participate in, Community Services. While Community Services may include information regarding Oracle products and services, including information from Oracle employees, they are not an official customer support channel for Oracle.
    You may use Community Services subject to the following: (a) Community Services may be used solely for your personal, informational, noncommercial purposes; (b) Content provided on or through Community Services may not be redistributed; and (c) personal data about other users may not be stored or collected except where expressly authorized by Oracle
    >
    Also please read the FAQ on how to ask questions.
    SQL and PL/SQL FAQ
    >
    2) Thread Subject line
    Give your thread a meaningful subject, not just "help please", "Query help" or "SQL". This is the SQL and PL/SQL forum. We know your question is going to be about those things, make it meaningful to the type of question so that people with the right sort of knowledge can pick it up and those without can ignore it. Never, EVER, mark your subject as "URGENT" or "ASAP"; this forum is manned by volunteers giving their own time to help and your question is never urgent or more important than their own work or than other people's questions. It may be urgent to you, but that's not forum members issue.

  • 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.

  • Loading images in a table and show this image in a html form

    Hi All,
    I'am a newbie in Oracle and PL/SQL.
    I need to load a image in a table and restrive this image and show it in a html form. I'd like to use a PL/SQL procedure.
    Thanks in advance for any suggestions.

    Hi,
    This forum is for Oracle9iAS Web Services discussion.
    I would recommend that you post your question to the 9iAS - General discussion forum.
    Regards,
    Tim

  • How to use an html form to search my database??

    Hey guys,
    I'm going through 100's of tutorials on creating a PHP CMS structure for my website and did manage to build a very simple 1. I have 1 question that i need your help with. I was browsing through websites on Google and discovered this website that you can search their data base with a an html form. How can I achieve this in the most simplest ways.
    Site URL: http://www.istructe.org/yearbook/index.asp
    Yours
    Ashveer

    The form's data is submitted to a php script.  The script harvests the data and formulates a SQL select statement -
    SELECT * FROM TABLE WHERE fieldname1 = fieldvalue1 AND fieldname2 = fieldvalue2....
    (the form's fields are used to build the WHERE part of the statement)
    After executing the search the script looks at the number of records found.  If that is zero, there were no matches.  If there is 1 or more records found, each is printed to the page.  You would need some facility with a server scripting language to do this, although not too much.  It's fairly simple.

  • How to reference html form element in javascript ?

    Dear all,
    My DPK portlet is like this:
    I created a html form within it there a several textfields, a hidden field and a SUBMIT button.
    The application will call itself to insert a new record to database table on pressing the SUBMIT button.
    My problem is that since all the form textfields and the hidden field ara all the qualified names, and I want to set the hidden field to some value, say "ADD" on the onsubmit event in the form. How can I reference the hidden field in javascript ?
    Or can you suggest another strategy to do that ?
    Many thanks
    George (HK)
    Here are the code fragment:
    String portletParamSubmit = "mSubmit";
    String portletParamTitle = "mTitle";
    String portletParamURL = "mURL";
    String portletParamAction = "mAction";
    //Fully qualified URL.
    String fSubmit = HttpPortletRendererUtil.portletParameter(request, portletParamSubmit);
    String formName = UrlUtils.htmlFormName(pReq, null);
    String fTitle = HttpPortletRendererUtil.portletParameter(request, portletParamTitle);
    String fURL = HttpPortletRendererUtil.portletParameter(request, portletParamURL);
    String fAction = HttpPortletRendererUtil.portletParameter(request, portletParamAction);
    String vl_Title = "";
    String vl_URL = "";
    String vl_Action = "";
    String vl_result = "";
    if( pReq.getQualifiedParameter(portletParamAction) == "ADD")
    vl_Title = pReq.getQualifiedParameter(portletParamTitle);
    vl_URL = pReq.getQualifiedParameter(portletParamURL);
    //Add News.
    try{
    CallableStatement cs_2 = conn_erp03.prepareCall("{call XXCT_PORTAL_NEWS_PKG.P_ADD_NEWS(?,?,?,?,?,?)}");
    cs_2.setString(1, "ADD");
    cs_2.setString(2, pReq.getUser().getName());
    cs_2.setString(5, vl_Title);
    cs_2.setString(6, vl_URL);
    cs_2.registerOutParameter(10,Types.VARCHAR);
    cs_2.execute();
    vl_result = cs_2.getString(10);
    cs_2.close();
    catch (SQLException se) {
    sb.append("Query: SQL Exception: " + se.toString());
    System.out.println(sb);
    %>
    <head>
    <script language = "Javascript">
    <!--
    function SetAction() {
    document.<NAME THE OF HIDDEN FIELD>.value = 'ADD'; <====How to refer it ?
    return 1;
    // -->
    </script>
    </head>
    <body>
    <form name="<%=formName%>" method= "POST" action="<%=UrlUtils.htmlFormActionLink(pReq, UrlUtils.PAGE_LINK)%>" onSubmit="return SetAction()">
    <%= UrlUtils.htmlFormHiddenFields(pReq, UrlUtils.PAGE_LINK, formName)%>
    <table>
    <tr>
    <td>Title</td>
    <td><input type="text" length=100 name="<%=fTitle%>"></td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td>URL</td>
    <td><input type="text" name="<%=fURL%>"></td>
    <td> </td>
    <td> </td>
    </tr>
    <tr>
    <td><INPUT type="submit" name="mysubmit" value="ADD NEWS"></td>
    <td><input type="hidden" name="<%=fAction%>"></td>
    <td> </td>
    <td> </td>
    </tr>
    </table>
    </body>

    hi Neeraj Sidhaye,
    After trying your suggest codings,
    I come to the problem of null pointer exception message captured in the application log file as:
    06/08/11 11:48:57 Prj_News: [instance=212602_PORTLET_NEWS_49519249, id=79187977878,4] ERROR: AbstractResourceRenderer.renderBody - recieved ServletException. Root cause is
    java.lang.NullPointerException
    What's wrong ?
    George (HK)
    Here is my coding:
    <%@page contentType="text/html; charset=Big5"
    import="javax.naming.*"
    import="javax.sql.*"
    import="java.sql.*"
    import="oracle.jdbc.*"
    import="java.sql.Date"
    import="java.util.*, oracle.portal.provider.v2.*"
    import="oracle.portal.provider.v2.http.HttpCommonConstants"
    import="oracle.portal.provider.v2.render.PortletRendererUtil"
    import="oracle.portal.provider.v2.render.PortletRenderRequest"
    import="oracle.portal.provider.v2.render.http.HttpPortletRendererUtil"
    import="oracle.portal.provider.v2.url.UrlUtils"
    %>
    <%
    StringBuffer sb = new StringBuffer();
    PortletRenderRequest pReq = (PortletRenderRequest)request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    %>
    <%
    //Database connection.
    InitialContext ic = new InitialContext();
    DataSource ds_erp03 = null;
    Connection conn_erp03 = null;
    try {     
    ds_erp03 = (DataSource)ic.lookup("jdbc/ERP03_DS");
    conn_erp03 = ds_erp03.getConnection();
    catch (SQLException se) {
    sb.append("Connection: SQL Exception: " + se.toString());
    System.out.println(sb);
    catch (NamingException ne) {
    sb.append("Connection: Naming Exception: " + ne.toString());
    System.out.println(sb);
    %>
    <%
    //Self defined names.
    String portletParamSubmit = "mSubmit";
    String portletParamMainCat = "mMainCat";
    String portletParamSubCat = "mSubCat";
    String portletParamTitle = "mTitle";
    String portletParamURL = "mURL";
    String portletParamDescription = "mDescription";
    String portletParamEffDateFm = "mEffDateFm";
    String portletParamEffDateTo = "mEffDateTo";
    String portletParamAction = "myAction";
    //Fully qualified URL.
    String fSubmit = HttpPortletRendererUtil.portletParameter(request, portletParamSubmit);
    String formName = UrlUtils.htmlFormName(pReq, null);
    String fMainCat = HttpPortletRendererUtil.portletParameter(request, portletParamMainCat);
    String fSubCat = HttpPortletRendererUtil.portletParameter(request, portletParamSubCat);
    String fTitle = HttpPortletRendererUtil.portletParameter(request, portletParamTitle);
    String fURL = HttpPortletRendererUtil.portletParameter(request, portletParamURL);
    String fDescription = HttpPortletRendererUtil.portletParameter(request, portletParamDescription);
    String fEffDateFm = HttpPortletRendererUtil.portletParameter(request, portletParamEffDateFm);
    String fEffDateTo = HttpPortletRendererUtil.portletParameter(request, portletParamEffDateTo);
    // String fAction = HttpPortletRendererUtil.portletParameter(request, portletParamAction);
    String fAction="myAction";
    String vl_MainCat = "";
    String vl_SubCat = "";
    String vl_Title = "";
    String vl_URL = "";
    String vl_Description = "";
    String vl_EffDateFm = "";
    String vl_EffDateTo = "";
    String vl_Action = "";
    String vl_result = "";
    %>
    <%
    if( pReq.getQualifiedParameter(portletParamAction).equals("ADD")) <= This line cause the null pointer exception <<<<<<<<
    vl_MainCat = pReq.getQualifiedParameter(portletParamMainCat);
    vl_SubCat = pReq.getQualifiedParameter(portletParamSubCat);
    vl_Title = pReq.getQualifiedParameter(portletParamTitle);
    vl_URL = pReq.getQualifiedParameter(portletParamURL);
    vl_Description = pReq.getQualifiedParameter(portletParamDescription);
    vl_EffDateFm = pReq.getQualifiedParameter(portletParamEffDateFm);
    vl_EffDateTo = pReq.getQualifiedParameter(portletParamEffDateTo);
    //Add News.
    try{
    CallableStatement cs_2 = conn_erp03.prepareCall("{call XXCT_PORTAL_NEWS_PKG.P_ADD_NEWS(?,?,?,?,?,?,?,?,?,?)}");
    cs_2.setString(1, "ADD");
    cs_2.setString(2, pReq.getUser().getName());
    cs_2.setString(3, pReq.getQualifiedParameter(portletParamMainCat));
    cs_2.setString(4, pReq.getQualifiedParameter(portletParamSubCat));
    cs_2.setString(5, pReq.getQualifiedParameter(portletParamTitle));
    cs_2.setString(6, pReq.getQualifiedParameter(portletParamURL));
    cs_2.setString(7, pReq.getQualifiedParameter(portletParamDescription));
    cs_2.setString(8, pReq.getQualifiedParameter(portletParamEffDateFm));
    cs_2.setString(9, pReq.getQualifiedParameter(portletParamEffDateTo));
    cs_2.registerOutParameter(10,Types.VARCHAR);
    cs_2.execute();
    vl_result = cs_2.getString(10);
    cs_2.close();
    catch (SQLException se) {
    sb.append("Query: SQL Exception: " + se.toString());
    System.out.println(sb);
    %>
    <SCRIPT SRC="<%=HttpPortletRendererUtil.absoluteLink(pReq,"clock.js")%>"></SCRIPT>
    <LINK REL=stylesheet TYPE="text/css" HREF="<%=HttpPortletRendererUtil.absoluteLink(pReq,"tables_style.css")%>">
    <head>
    <script language = "Javascript">
    <!--
    function doSubmit(myAction)
    // alert(myAction);
    if(myAction == 'ADD')
    document.forms[0].<%=fAction%>.value="ADD";
    else if(myAction == 'DELETE')
    document.forms[0].<%=fAction%>.value="DELETE";
    document.forms[0].submit();
    // -->
    </script>
    </head>
    <body>
    <form name="<%=formName%>" method= "POST" action="<%=UrlUtils.htmlFormActionLink(pReq, UrlUtils.PAGE_LINK)%>">
    <%= UrlUtils.htmlFormHiddenFields(pReq, UrlUtils.PAGE_LINK, formName)%>
    <table>
    <tr>
    <td style="color:#fff;font-family:'Arial';font-size:14px;text-align:right;">Page</td>
    <td>
    <select name="<%=fMainCat%>">
    <option value="X">-- Please select --
    <option value="FAE">FAE
    <option value="PM">Product Marketing
    <option value="RD">R&D
    <option value="BU">Business Unit
    </select>
    </td>
    <td style="color:#fff;font-family:'Arial';font-size:14px;text-align:right;">Region</td>
    <td>
    <select name="<%=fSubCat%>">
    <option value="X">-- Please select --
    <option value="1">Region 1
    <option value="2">Region 2
    <option value="3">Region 3
    <option value="4">Region 4
    </select>
    </td>
    </tr>
    <tr>
    <td style="color:#fff;font-family:'Arial';font-size:14px;text-align:right;">Date From</td>
    <td><input type="text" size="6" maxlength="10" name="<%=fEffDateFm%>"></td>
    <td style="color:#fff;font-family:'Arial';font-size:14px;text-align:right;">Date To</td>
    <td><input type="text" size="6" maxlength="10" name="<%=fEffDateTo%>"></td>
    </tr>
    </table>
    <table>
    <tr>
    <td style="color:#fff;font-family:'Arial';font-size:14px;text-align:right;">Title</td>
    <td><input type="text" size="100" maxlength="100" name="<%=fTitle%>"></td>
    </tr>
    <tr>
    <td style="color:#fff;font-family:'Arial';font-size:14px;text-align:right;">URL</td>
    <td><input type="text" size="100" maxlength="200" name="<%=fURL%>"></td>
    </tr>
    <tr>
    <td style="color:#fff;font-family:'Arial';font-size:14px;text-align:right;">Description</td>
    <td><textarea id="description" rows="5" cols="76" maxlength="500" name="<%=fDescription%>"></textarea></td>
    </tr>
    <tr>
    <td><input type="hidden" id="<%=fAction%>" name="<%=HttpPortletRendererUtil.portletParameter(request, portletParamAction)%>"></td>
    <td><input type=button value="Add" onClick="doSubmit('ADD')"></td>
    </tr>
    </table>
    </form>
    </body>

  • Question about running a servelt using HTML form.

    Hi, Im new to Servlets , I have created a servelt with this code :
    package oracle.servlets;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class LoginServlet extends HttpServlet {
        private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
        private static final String DB_URL = "jdbc:oracle:thin:@localhost:1521:ahmaddb";
        private static final String DB_USERNAME = "fundinfo";
        private static final String DB_PASSWORD = "tadapps";
        private static Connection con;
        private String pass;
        private String name;
    /*init() : invoked by the servlet engine before the servicing of client requests
    - Can be used to retrieve initialization parameters
    – Takes a ServletConfig object as a parameter
    – Is invoked when the servlet instance is created
    – Is useful for obtaining database connections from a connection pool*/
        public void init(ServletConfig config) throws ServletException {
            super.init(config);
            //config.getInitParameter(arg0);
        public void doGet(HttpServletRequest request,
                          HttpServletResponse response) throws ServletException,
                                                               IOException {
    response.setContentType(CONTENT_TYPE);
            //PrintWriter : Print formatted representations of objects to a text-output stream.
            //getWriter() : Returns a PrintWriter object that can send character text to the client.
            PrintWriter out = response.getWriter();
            out.println("<html>");
            out.println("<head><title>My First Servlet</title></head>");
            out.println("<body>");
            out.println("<p>The servlet has received a GET. This is the reply.</p>");
            out.println("</body></html>");
            out.close();
        public void doPost(HttpServletRequest request,
                           HttpServletResponse response) throws ServletException,
                                                                IOException {
            response.setContentType(CONTENT_TYPE);
            PrintWriter out = response.getWriter();
            name = request.getParameter("user_name");
            pass = request.getParameter("user_password");
            boolean result = verifyPassword(name, pass);
            out.println("<html>");
            out.println("<head><title>LoginServlet</title></head>");
            out.println("<body>");
            if (result == true){
            out.println ("Hello " + name + ": Your login module is working great!");
            else{
            out.println ("Invalid user name or password");
            out.println ("</body></html>");
            out.close();
            // out.println("<p>The servlet has received a POST. This is the reply.</p>");
            //out.println("</body></html>");
            //out.close();
        public void configureConnection() throws SQLException {
        try{
        Class.forName("oracle.jdbc.OracleDriver");
        con = DriverManager.getConnection(DB_URL, DB_USERNAME,DB_PASSWORD);
        con.setAutoCommit(true);
        catch (Exception e){
        System.out.println("Connection failed: " +e.toString());
        public Connection getConnection() throws SQLException
        configureConnection();
        return con;
        protected boolean verifyPassword(String theuser, String password) {
        String originalPassword = null;
        try {
        con = getConnection();
        Statement stmt = con.createStatement();
        stmt.executeQuery("select password from login where uname='"+theuser+"'");
        ResultSet rs = stmt.getResultSet();
        if(rs.next())
        //>>
        originalPassword = rs.getString(1);
        stmt.close();
        if(originalPassword.equals(password)) {
        return true;
        else {
        return false;
        catch (Exception e){
        System.out.println("Exception in verifyPassword()="+e.toString());
        return false;
    }and created an HTML form to target this servlet
    <form action="/loginservlet" method="post">,
    when I enter the the credintials I get this output in the webpage :
    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.

    Thanks , yes it is added to the web.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
        <description>Empty web.xml file for Web Application</description>
        <servlet>
            <servlet-name>LoginServlet</servlet-name>
            <servlet-class>oracle.servlets.LoginServlet</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>LoginServlet</servlet-name>
            <url-pattern>/loginservlet</url-pattern>
        </servlet-mapping>
        <session-config>
            <session-timeout>35</session-timeout>
        </session-config>
        <mime-mapping>
            <extension>html</extension>
            <mime-type>text/html</mime-type>
        </mime-mapping>
        <mime-mapping>
            <extension>txt</extension>
            <mime-type>text/plain</mime-type>
        </mime-mapping>
    </web-app>Anymore suggestions?

  • How to upload a file with a HTML form into a BLOB ?

    Hi,
    I want to upload a file into a BLOB.
    I have created a procedure in PL/SQL whitch generates an html form.
    You can upload a file with <input type="file" name="my_file">.
    How can I insert this file into my database ?
    Thank's for your Help
    Estelle

    Hi Estelle,
    Portal Applications forum is a more apporpriate forum for such questions. Please post your question there.
    Thanks,
    Ravi

  • Unclean conversion of chart reports to html form

    dear all,
    i created some charts like pie, bar graphs. i want to convert
    that chart reports to html form.
    my problem is that after conversion of chart reports to html form,
    whatever the part of chart is unclean, it's totally in block colour.
    what to do to present that chart part in RGB colour format on
    the web. please some one help me as it is urgently required.
    i am using the reports buider 6i.
    thanks in advance

    Here 'part of chart is unclean' means: that a report contained
    two parts one is normal )in the form of data) , 2nd one is graphical
    representation(pie or bar graph which is imported from graphics
    builder) of that dat.
    The above quoted statement means that graphical representation
    part is not clear.
    i tried for the solution(Danny's suggestion). but it didn't workout.
    could any one tell another solution?
    TIA

  • 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

  • How come the item value does not come thru via PL/SQL anonymous block?

    Hi,
    It's a Form with 3 tables -
    1) ClinicianProfileTb (with about 40 columns, insert/update via DML),
    2) PeopleTb (with about 7 columns, insert/update via PL/SQL anonymous block) and
    3) ClinicianPracticeTb (with about 10 columns, insert/update via PL/SQL anonymous block) for after-submit-processes.
    So I have several After-Submit-Processes. For some reason, it appears that PeopleId which is supposed to come thru via the 2nd After-Submit-Process (ie: Insert/Update PeopleTb) does not do the way it's supposed to. And when I press "Create" button at the bottom, I got the following error msg:
    ORA-01400: cannot insert NULL into ("TEST_0712"."CLINICIANPRACTICETB"."PEOPLEID")
    I tried the "debug" mode (via edit page link), but to no avail. (I'm newbie, trying to learn and deliver at the same time :)).
    I uploaded the app to apex.oracle.com, if someone could kindly take a look and let me know what goes wrong, it'd be greatly appreciated.
    workspace: test_0712
    app: 43408 - TEST
    user: demo
    pswd: demoPswd
    Page#21 -> look at the After-Submit-Processes -> in "Insert/Update PeopleTb" it appears that PeopeId does not come thru; thus it cannot be updated to ClinicianProfileTb.PeopleId (allows null) -> and thus cannot be inserted into ClincianPracticeTb.PeopleId (which does NOT allow null). Basically my logic is that in order to create ANY row in ClinicianPracticeTb, BOTH PracticeId AND PeopleId must be present.
    Acutally I should have used the PeopeTb as DML (as the driving table) to enforce that PeopleId must be present in order to insert ClinicianProfileTb and ClinicianPracticeTb, but it'd be lots of codes to write to insert/update in ClinicianProfileTb (40 columns).
    In addition, does ApEx consider EVERY SINGLE after-submit-process are in ONE transaction for commit/rollback? It appears that it treats all PL/SQL anonymous blocks are in ONE transaction, while Automatic Row Processing (DML) is commited/rolled back on its own?
    Thanks much,
    Helen

    All blocks that do not commit in one of the ways I detailed (and which do not explicitly commit using a commit statement) are part of the transaction started with > the first DML statement issued in any of the page processes and continuing until a commit is issued.Say, there are the following processes in the After-Submit-Processes:
    1. Process1 -> Automatic Row Processing (DML)
    2. Process2 -> PL/SQL anonymous block
    3. Process3 -> PL/SQL anonymous block
    Based on what you describe, in the event that if there is no explicit "commit" issued in any of these processes, then an implicit "commit" will be issued at the end of Process3?
    Thanks, Scott.
    Doreen

  • Using JSP, HTML Form for uploading image  in order to be saved into a db

    I have a HTML form and I am using <input type="file"> tag. The problem is that I don't know the Java code needed for the JSP page in order to get through the path and get the image(of course I refer to binary object). Below there is the html code
    <%@ page language="java" import="java.sql.*, java.awt.*, java.awt.Event, java.util.*, java.io.*, javax.servlet.*"%>
    <html>
    <head>
    </head>
    <body>
    <div align="left"></div>
    <form action="action.jsp" method="POST" name="form"
    <h1>Add Data</h1>
    <table>
    <tr>
    <td>Name</td>
    <td><input type="text" name="Name" value="" /></td>
    </tr>
    <tr>
    <td>Last Name</td>
    <td><input type="text" name="lastname" value=""/></td>
    </tr>
    <tr>
    <td>Studies</td>
    <td><textarea name="studies" rows="4" cols="20" >
    </textarea>
    </td>
    </tr>
    <tr>
    <td>General Data</td>
    <td><textarea name="gendata" rows="4" cols="20">
    </textarea>
    </td>
    </tr>
    <tr>
    <td>Photo</td>
    <td><input type="File" name="photo"/></td>
    </tr>
    <tr>
    <td> <input type="submit" > </td>
    </tr>
    </table>
    </form>
    If you want to view the Personnel List click here<br>
    Go to index
    </body>
    </html>

    A JSP should not be involved in this. The browser will offer a way to specify a file, and the target of the form should be a servlet that can handle multipart uploads. JSPs should not process any input.
    More info: http://www.jguru.com/faq/view.jsp?EID=160 or Google

  • Link an HTML form to Open Directory/PostgreSQL?

    Hey all,
    I'm trying to make an HTML form on one of my websites so that I can "log in" to my website in the same way I'd log in if I restrict access to a website via Server.  I figure I'll have to get my hands dirty with PostgreSQL, the SQL backend for OS X Server, though I'm hoping someone has done this before, and can sort of guide me through it.
    I'm starting to think I should just go Linux and configure everything (Apache 2, PostgreSQL, VNC, FTP, etc.) separately... Server makes things easy, but obviously at the cost of complete control.  If you have any input on this as well, I'd appreciate it!

    Hey all,
    I'm trying to make an HTML form on one of my websites so that I can "log in" to my website in the same way I'd log in if I restrict access to a website via Server.  I figure I'll have to get my hands dirty with PostgreSQL, the SQL backend for OS X Server, though I'm hoping someone has done this before, and can sort of guide me through it.
    I'm starting to think I should just go Linux and configure everything (Apache 2, PostgreSQL, VNC, FTP, etc.) separately... Server makes things easy, but obviously at the cost of complete control.  If you have any input on this as well, I'd appreciate it!

  • Accessing html field value from pl/sql code, in the same package

    hi friends,
    my pl/sql web application is working fine. but now i need a small requirment.
    ie, basicaly i need to access the user entered value of an element in html based form from pl/sql code, which is developed using pl/sql toolkit.
    Here is the scenario:-
    User entered a value in field1, then navigate to field2, and click a button for list of values,
    when he clicks the button, internaly it is opening a cursor, where i want to pass field1's value to my cursor as a parameter. So in my pls/sql code , i want to access the value of field1. If you know, please help.
    see the snippet of code.
    htp.p('
    function f1()
    if (parseInt(learnIdx) ==1 )
    for i in dev_Need('1')/*here i want to pass html form element value as a parameter */
    loop
    htp.p('content += "<option value='''||a.version_name||'''>'||a.version_name
    ||'</option>''"; ');
    end loop;
    thanks in advance.
    Zameer.N.A

    Hi,
    Here's my suggestion
    If you wanna access the dll check out "external procedures", you can search it everywhere in OTN.
    However it's easier to use Heterogenous Services to connect database with other sources.
    Check out http://asktom.oracle.com/pls/ask/f?p=4950:8:13454621522426176943::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:4406709207206,
    Tak Tang answer on May, 25, 2004 rules!

  • Again : HTML-form in report body- error

    I want to display a report based on a complex view, but I want to make each record updateable via an HTML-form. I added to the view a column which generates HTML, but when I change the combobox, I get an error in the status-bar of the browser "Object doesn't support this property or method."
    The submit-action (do_update) is a PL/SQL procedure.
    example-record :
    Customer oriented <form name="theForm" action="do_update"><input type=hidden value="393" name="p_pmei_id"><select NAME="p_pmei_score" size="1" ONCHANGE="javascript:document.theForm.submit()"><option value="A">A</option><option value="B">B</option><option value="C">C</option><option value="D">D</option><option value="">--</option></select></form>
    Quality-minded <form name="theForm" action="do_update"><input type=hidden value="394" name="p_pmei_id"><select NAME="p_pmei_score" size="1" ONCHANGE="javascript:document.theForm.submit()"><option value="A">A</option><option value="B">B</option><option value="C">C</option><option value="D">D</option><option value="">--</option></select></form>
    null

    The problem is solved ! I used the same form_name for each record, wich caused the error.

Maybe you are looking for

  • Best Usage reporting tool for SharePoint 2013 (onpremises)

    Please suggest me best reporting tool for SharePoint 2013 on premises. Need to get site usage summary for any time in last one year. Need to get library/list usage summary for any time in last one year. etc. How many peak hits and unique no of users

  • Material Cost difference at the time of MIGO

    Dear Experts, My problem is *MIGO is done for material against PO & posting is also done but some difference amount is posted to Material Cost Difference because of which my bill is not passing. * Can any body guide me? We have activated ML, actuale

  • Problem in dynamically file name generation procedure

    Hi All,           I had scenario where i need to generate target filename dynamically for that i'm using UDF mentioned in the below blog : /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 to

  • Smbd - let client move files on share without local copy

    I have a file server running Arch and samba 4.0.5. It serves a single share /mnt/share This share is mounted on a notebook thats connected to the local network via WLAN and running windows 8 (tried OS X too). When i now try to move or copy files on t

  • Add people analysis not working in Elements 11

    Hello, The Add People feature has stopped working in Elements 11.  I just get the message "no new people found in your selection".  Yet, when i open a picture there will be faces that are marked in the photo awaiting tagging.  I have thousands of pho