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.

Similar Messages

  • Call a servlet file from SSMS

    How to call a Servlet file from a Stored Procedure?

    You need to make an http request to the web server where the servlet is running. To do this you have two options:
    Using object automation stored procedures (sp_OA* procedures) to create and call MSXML2.XMLHttp COM objects.
    Create a CLR stored procedure that uses HttpWebRequest class.
    On the other side. Making web request from stored procedures is the last resort. Have you considered other alternatives to solve the bussines problem at hand?
    For example Service Broker can be an alternative for that kind of problems. The stored procedure sends a message to the queue. An external program reads messages as it arrives to the queue and process them. The external program can be written in Java and
    can run in the web server where the servlet runs.
    EntityLite: A Lightweight, Database First, Micro ORM

  • Generating XSD files from an HTML form......

    What is the best way to generate XML Schema files from an HTML form? Are there any APIs, Frameworks, software products, that already do this for you? What is the best way to do this programmatically?
    I was thinking about using DOM...
    Any help and/or advice will be greatly appreciated...
    With thanks,
    Unnsse Khan

    users select what they want in their schemas
    If the Schema info is added in a JSP.
    Element Name: elementA
    Data Type: string
    Sub-Elements(Sequence): elementB, elementC
    The field values may be retreived with with the getParameter method.
    String elementName=request.getParameter("ElementName");
    String type=request.getParameter("DataType");
    From the values retreived a Schema may be constructed with the org.w3c.dom.* classes.

  • Create Form Beans from JSP/HTML forms

    In the Builder certification objectives, there is one called "Create Form Beans from JSP/HTML forms". How can I do that? How can I create a form beam starting from the JSP form or HTML form?

    Guys, no one from forum can answer this question?

  • How to retrieve input data from a HTML form in the UTF-8 cha

    I encountered the following problem with a JWeb Application:
    I tried to write a JWeb-Application for OAS 4.0, that retrieves
    input data from a HTML form and writes it into an Oracle
    database.
    All processing should be done in the UTF-8 character set.
    The problem is, that the form data retrieved by getURLParameter
    are always encoded in a non-unicode character set and I found no
    way to change this.
    Can anybody tell me what I should do to get the form data in the
    UTF-8 character set?
    null

    Hi
    Try set in the JWEB application's Java environment such
    SYSTEM_PROPERTY: file.encoding=UTF8.
    Andrew
    Thomas Gertkemper (guest) wrote:
    : I encountered the following problem with a JWeb Application:
    : I tried to write a JWeb-Application for OAS 4.0, that
    retrieves
    : input data from a HTML form and writes it into an Oracle
    : database.
    : All processing should be done in the UTF-8 character set.
    : The problem is, that the form data retrieved by getURLParameter
    : are always encoded in a non-unicode character set and I found
    no
    : way to change this.
    : Can anybody tell me what I should do to get the form data in
    the
    : UTF-8 character set?
    null

  • How to call a Report 10g from a parameter form..?

    Hello,
    pls i wanna know the procedure of :
    How to call a Report 10g from a parameter form..?
    regards,
    Abdetu..

    hopes it work for you.
    procedure get_report is
    pl_id paramlist;
    p_year varchar2(4);
    param_name varchar2(10) :'param';
    begin
    pl_id := get_parameter_list(param_name);
    if not id_null(pl_id_)then
    destroy_parameter_list(pl_id);
    end if;
    pl_id := create_parameter_list(param_name);
    p_year := year -- assign the value.
    add_parameter(pl_id,'p_year',text_parameter,p_year);
    execute_report('report_name',pl_id);
    end;

  • How to call a COM object from an Oracle Form?

    Hi All,
    Pls advice. How to call a COM object from an Oracle Form?
    Thanks.

    try asking the "Form" forum

  • Error while calling standard OAF page from custom Oracle Form

    Hi,
    I am calling standard OAF page from custom oracle form using the following code.
    FND_FUNCTION.EXECUTE(FUNCTION_NAME=>'FUN_TRX_ENTRY_OUT_VIEW_BATCH',
    OPEN_FLAG =>'Y',
    SESSION_FLAG =>'N' ,
    OTHER_PARAMS =>'&ViewBatchID = "' || NAME_IN('FUN_AGIS_LINE_D.BATCH_ID') ||
                        '&CallingFunction = "' || 'MANEXPINQ' ||'"');
    But I am getting this error.
    oracle.apps.fnd.framework.OAException: This request was not processed as the request URL %2FOA_HTML%2FOA.jsp%3Fpage%3D%2Foracle%2Fapps%2Ffun%2Ftransaction%2Fentry%2Fwebui%2FViewOutBatchPG%26OAPB%3DFUN_PRODUCT_BRAND%26OAHP%3DFUN_SSWA_MENU%26OASF%3DFUN_TRX_ENTRY_OUT_SEARCH%26_ti%3D1217029204%26language_code%3DUS%26%26ViewBatchID%20%3D%20%22203148%26CallingFunction%20%3D%20%22MANEXPINQ%22%26CallFromForm%3D%27Y%27%26oas%3DqZqg3tmdEdUNyw_HtskVow.. contained potentially illegal or un-encoded characters. Please try again by submitting a valid URL or contact your systems administrator for assistance.
    Please let me know any thing I missed out here.
    Any suggestion will highly appreciated.
    Thanks & Regards,
    Sunita

    I am using FND_FUNCTION.EXECUTE to call a OAF page from PLSQL in R12. I am getting following error"Error(9,23): PLS-00302: component 'EXECUTE' must be declared"

  • MySQL:  SELECT * FROM with a Variable from an HTML form

    Hello,
    I would like to insert the variable "find" from the HTML form below in the MySQL "SELECT * FROM" query beneath it.  In other words, where the word "santafe" appears below, I would like to insert the variable "$find."  But I can't quite get it to work.  How do I do it?
    Thanks in advance,
    John
    <form action="tsearch11.php" method="post">
    <label>Enter Topic:
    <input type="text" name="find" size="55"/>
    <input type="hidden" name="searching" value="yes" />
    <input type="submit" name="search" value="Search" />
    </label>
    </form>
    Then, on tsearch11.php:
    <?
    mysql_connect("mysqlv3", "username", "password") or die(mysql_error());
    mysql_select_db("sand2") or die(mysql_error());
    $find = strip_tags($find);
    $find = trim ($find);
    $t = "SELECT * FROM santafe"; 
    $y = mysql_query($t);
    ?>

    Putting a form variable in a SQL query to look for table or column names requires an extra level of security. You need to create an array of the valid names, and check that the form variable is in that array.
    $find = get_magic_quotes_gpc() ? stripslashes($_POST['find']) : $_POST['find'];
    $find = mysql_real_escape_string(trim($find));
    // create an array of valid table names
    $tables = array('santafe', 'sanfernando', 'guadalupe');
    // check that the variable is in the permitted array
    if (in_array($find, $tables)) {
      $t = "SELECT * FROM $find"; 
      $y = mysql_query($t);
    } else {
      $error = 'Sorry, you selected an invalid table.';
    In the page itself, check whether $y exists before using it. Otherwise display the error:
    if (isset($y)) {
      // display the results
    } elseif (isset($error)) {
      echo $error;

  • Create an XML document from a HTML form???

    Good morning, is it possible to create an XML document from a HTML form
    if yes, can someone tell me how to proceed exactely, I would be very thankful!

    Hi,
    A very simple intro at this link. Apologies for anything unclear.
    http://cswww.essex.ac.uk/TechnicalGroup/TechnicalHelp/xmlCreate.htm
    best
    kev

  • How can I call a servlet method from a javascript function

    I want to call l a servlet method from a javascript function.
    Does any one have an example of code.
    Thinks in advance

    Actually, as long as the servlet returns valid javascript, you can indeed "call it" from the client. It will initiate a request and return the result to the browser.
    This example uses Perl, but it could be easily modified to go to a servlet instead.
    Note that it is only supported in DOM browsers (IE6+/NN6+/etc)
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
    <html>
    <head>
    <title> Test server-side JS </title>
    </head>
    <body>
    <script type="text/javascript">
    function checkIt(variable, value)
    var newScript = "cgi-bin/validateJS.cgi?"+variable+"="+value;
    var body = document.getElementsByTagName('body').item(0)
    var scriptTag = document.getElementById('loadScript');
    if(scriptTag) body.removeChild(scriptTag);
    script = document.createElement('script');
    script.src = newScript;
         script.type = 'text/javascript';
         script.id = 'loadScript';
         body.appendChild(script)
    </script>
    <p>Test.</p>
    <form id="f1" action="">
    <input type="text" name="t1" id="t1" onChange="checkIt(this.name, this.value)">
    </body>
    </html>
    validateJS.cgi
    #!/opt/x11r6/bin/perl
    use CGI qw(:all);
    my @valArray = split(/=/,$ENV{QUERY_STRING});
    print "Content-type: text/javascript\n\n";
    # myPass is the password
    $myPass = "foobar";
    if ("$valArray[1]" eq "$myPass")
    print "alert(\"Success!!\")";
    else
    print "alert(\"Failure!!\")";

  • Calling a servlet method from another class

    hi...
    if i make a servlet (that keeps the log for website users' logins and logouts, for example) and i want a method that adds an entry into a logfile, for example:
    public void log(String line) {
    //put "line" into some log file...
    and then i set this servlet to loadonstartup, how can i call the log() function from other classes or servlets? can i do it without making the servlet an entry in servletContext?
    im sorry if i'm not being very clear, the caffeine's getting to me...
    thanks
    lazlo

    I don't know, why would you do that anyway? Just make an ordinary class, not a servlet, and make "log" a static method in that class. (If you need initialization, use a static initializer.) Put that class where the real servlet can see it and call it from there.

  • Help calling a web service from pl/sql

    Hi, i have a web service that is called from a php, i needed to do this but from pl sql:
    this is the call of web service from php:
    <?PHP
    //Variables de prueba - Se tienen que tomar los valores de la base de datos, de la compra y el usuario
    $p_id_emec=urlencode("33355555"); //Identificador del sitio dentro de Pago Fácil
    $p_id_operacion=urlencode("151"); //Identificador unívoco de la compra en el sitio
    $p_id_mone_ecom=urlencode("01"); //Identificador de moneda - '01'=pesos - '02=dolares
    //Inicializa Variables de URL
    $serviceName="Pago XX";
    $protocol="http://";
    // DESARROLLO
    $ipUrl="desa.e-pagoxx.com";
    $port=80;
    //Llamada
    $call="/2130/index.php";
    //Abro la conexion al port
    $URLsola = $protocol.$ipUrl;
    //Concatenacion del string
    $txtURL = $protocol.$ipUrl.$call;
    $txtURL .="?p_id_emec=".$p_id_emec;
    $txtURL .="&p_id_operacion=".$p_id_operacion;
    $txtURL .="&p_id_mone_ecom=".$p_id_mone_ecom;
    $txtURL = $txtURL;
    //* Se comunica con el servidor, pasa los datos y recibe el HTML con el comprobante *//
    $fp = fsockopen($ipUrl, $port, &$errno, &$errstr, 30);
    if(!$fp)
    echo "No me puedo comunicar con $serviceName";
    exit;
    else
    $file=@fopen($URLsola,"r");
    $pageData=file($txtURL);
    for($i=0;$i<count($pageData);$i++)
              $sText.=$pageData[$i];
    @fclose($file);
    @fclose($fp);
    echo($sText);
    ?>
    I need to call this webservice from pl sql
    any ideas?
    thanks!!

    Madhu BR wrote:
    You might want to try the webservice call using utl_http specified here : http://orclpps.blogspot.com/2007/12/invoking-webservices-from-oracle-9i-or.html
    Or even to expand on that to deal with responses larger than 32K...
    -- skeleton code
      PROCEDURE p_soap_request(p_username IN VARCHAR2, p_password IN VARCHAR2, p_proxy IN VARCHAR2) IS
        soap_request  VARCHAR2(30000);
        soap_respond  CLOB;
        http_req      utl_http.req;
        http_resp     utl_http.resp;
        resp          XMLType;
        soap_err      exception;
        v_code        VARCHAR2(200);
        v_msg         VARCHAR2(1800);
        v_len number;
        v_txt Varchar2(32767);
      BEGIN
        IF p_proxy IS NOT NULL THEN
          UTL_HTTP.SET_PROXY(p_proxy);
        END IF;
        -- Define the SOAP request according the the definition of the web service being called
        soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'||
                       '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'||
                       '  <SOAP-ENV:Body>'||
                       '    <m:DownloadRequest xmlns:m="http://www.website.net/messages/GetDetails">'||
                       '      <m:UserName>'||p_username||'</m:UserName>'||
                       '      <m:Password>'||p_password||'</m:Password>'||
                       '    </m:DownloadRequest>'||
                       '  </SOAP-ENV:Body>'||
                       '</SOAP-ENV:Envelope>';
        http_req:= utl_http.begin_request
                  ( 'http://www.website.net/webservices/GetDetailsService.asmx'
                  , 'POST'
                  , 'HTTP/1.1'
        utl_http.set_header(http_req, 'Content-Type', 'text/xml');
        utl_http.set_header(http_req, 'Content-Length', length(soap_request));
        utl_http.set_header(http_req, 'Download', ''); -- header requirements of particular web service
        utl_http.write_text(http_req, soap_request);
        http_resp:= utl_http.get_response(http_req);
        utl_http.get_header_by_name(http_resp, 'Content-Length', v_len, 1); -- Obtain the length of the response
        FOR i in 1..CEIL(v_len/32767) -- obtain response in 32K blocks just in case it is greater than 32K
        LOOP
            utl_http.read_text(http_resp, v_txt, case when i < CEIL(v_len/32767) then 32767 else mod(v_len,32767) end);
            soap_respond := soap_respond || v_txt; -- build up CLOB
        END LOOP;
        utl_http.end_response(http_resp);
        resp:= XMLType.createXML(soap_respond); -- Convert CLOB to XMLTYPE
      END;

  • Calling page or iView from KM HTML

    Hi All
    I have an requriement where-in, the page (or iView) should be called from a HTML which is actually stored in KM.
    The page that is to be called, should be displayed in a new window and should be headerless without an portal instance attached to it i.e. no desktop.
    I have used the NavigationTarget concept in the HTML and it indeed works... but however, it also displays the desktop. Is there any way to call the page without the desktop being attached to it..?? The page should be same the same window as we see in preview state i.e. headerless and only the contents being displayed.
    Thanks
    Deepak

    Hi All
    Thanks for the reply.
    @Stefan - I tried the EPCM navigation,but somehow it didn't work. Will look into it again.
    @Praveen - I had tried that option before posting on the forum. It works but also displays the portal desktop.
    @Sitara - This is something new to me. Let me try this one n post the results on the forum.
    Currently, i have created a button in HTML and on the click of it, it calls a Javascript function which returns the iView without portal desktop attached to it.
    My requriement is to replace the button with a link and use href property. I tried calling the javascript function in the href property, but it didn't work.
    Let me try Sitara's suggestion now.
    Regards
    Deepak

  • Calling a web service from Oracle 10g forms

    Hi Everybody
    I want to send SMS from my 10g forms.... I searched for the topic and I got the following link
    "http://www.oracle.com/technology/products/forms/htdocs/10gr2/howto/webservicefromforms/ws_10_1_3_from_forms.html"
    Now I have downloaded "wsclient_extended_101320.zip"
    1. extracted the jar file,
    2. copied the jar file in "c:\ids10\WSclient"
    3. Specified jar file name in "default.env" "formsweb.cfg"
    4. Also specified the jar file name in "CLASSPATH" environment variable
    5. restarted OC4J instance
    6. Restarted Fotm Builder
    But I couldn't see the "webServiceProxy.proxy.SendServiceSoapClient" in Form Builder "JAVA CLASS iMPORTER"
    Can anyone plz help.....
    Wat may be the problem??
    Do I hav to follow the steps to create service as specified in demo page....or is it sufficient to download the jar file ??
    Or is there any other setting that I m missing???
    Thanx in advance....

    I created a new folder "WSclient" in "c:\ids10\forms"
    and added full path name in CLASSPATH......

Maybe you are looking for

  • Weblogic deployment error

    I am trying to deploy a Very simple JFS Application that Connects to a Webservice and sends a request. When I run it in JDeveloper locally it works, but when i Deploy to Weblogic i get the following error: oracle/jrf/PortabilityLayerException [03:24:

  • IPhone 5 won't set up

    I am trying to set up my new iPhone 5 and I just synced all of my data to iTunes. It won't advance to the next step. It still says 'connect to iTunes' even though I already synced it.

  • I can't work my itunes match

    I ahve changed my apple id for itunes and my iphone, but when i attempt to use itunes match the old apple id is showing. How can I change this? I ahev already reset the phone to no use?

  • Caret position in JEditorPane HTML

    Hi everyone, I need the position of caret in HTML source on JEditorPane. I The value of getCaretPosition() seems not what I wanted. CaretEvent.getDot() gives the same value of getCaretPosition. These methods only gets position on the view. Please hel

  • Reading ACT (WPA) Files

    I don't know where else to post this. I'm looking for a utility that will convert WPA (ACT word processing files) to something I can read on the Mac. Has anyone had any success with this?