Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » Method POST in HTML FORM doesn't work in OracleWeblogic Server 11g Ver:10.3.3.0.
Method POST in HTML FORM doesn't work in OracleWeblogic Server 11g Ver:10.3.3.0. [message #489395] Sat, 15 January 2011 11:34 Go to next message
kantitil
Messages: 2
Registered: January 2011
Location: Chih., Mex.
Junior Member
Method POST in HTML FORM doesn't work in OracleWeblogic Server 11g Ver:10.3.3.0.

Im using Oracle Weblogic Server 11g Ver:10.3.3.0 (Production Environment).
I have created an application (Fusion Web App) .

The stage is:

  1. A third application must send parameters via Method post in html form to my application.
  2. In the PrepareModel of the backing bean of my jsp i get the HttpServletRequest Object.
  3. I access to the parameters in the HttpServletRequest.


The Problem:
I access to the parameters of the HttpServletRequest and they are always NULL, the data get lost.

I MUST do it by this way because is the only mode that other application send me the data (is a bank transaction).
I tried with differents browsers just for in case, but still the problem.

NOTE: This application was working PERFECTLY on OC4j on Oracle 10g Application Server but was migrated.

There may be some WEIRD CONFIGURATION to set on the Oracle Weblogic Server 11g, I hope so.

The simulation of the FORM that send the data by POST METHOD to my application:

  <html>
    <head>
      <meta http-equiv="Content-Type"
            content="text/html; charset=windows-1252"/>
      <title>Bank Response</title>
      <script languaje="JavaScript"  type="text/javascript" >
        function responder(){
          document.testform.submit();
        }
      </script>
    </head>
    <body>
      <form name="testform" action="myAppUrl" method="post">
          <input type="hidden" name="parameter1" value="value1"/>
          <input type="hidden" name="parameter2" value="value2"/>
          <input type="hidden" name="parameter3" value="value3"/>
        </form>
    </body>
  </html>


The code i use in the managed bean of the JSP (get parameters from HttpServeletRequest):

 public void prepareModel(LifecycleContext context) {
        super.prepareModel(context);
        ADFContext adc = ADFContext.getCurrent();
        FacesContext facesContext = FacesContext.getCurrentInstance();
        try {
            HttpServletRequest request =
                (HttpServletRequest)facesContext.getExternalContext().getRequest();
            System.out.println(request.getParameter("parameter1"));//GIVES ME A NULL VALUE
            System.out.println(request.getParameter("parameter2"));
            System.out.println(request.getParameter("parameter3"));
        } catch(Exception ex) {
                ex.printStacktrace();
        }
}


Thank You.

[Updated on: Sat, 15 January 2011 12:26]

Report message to a moderator

Re: Method POST in HTML FORM doesn't work in OracleWeblogic Server 11g Ver:10.3.3.0. [message #489578 is a reply to message #489395] Mon, 17 January 2011 12:39 Go to previous message
kantitil
Messages: 2
Registered: January 2011
Location: Chih., Mex.
Junior Member
Hi

I have solved my issue thanks to the tip posted by Frank Nimphius, it works just fine. Thanks a lot!!

i leave the answer here:

"on the f:view element of the JSPX page, define the afterMethod property to point to a managed bean method. In this managed bean method, determine the phase and if this phase is afterRestore, read the request parameter if it exists (make sure you check if the parameter exists). If the parameter exists, write it to a memeory scope like viewScope or session. Then when you need this parameter in the managed bean, get it from the memory scope.

Frank"

THANKS A LOT !
Previous Topic: Oracle AS 10g
Next Topic: Oracle Application Server Installation Windows 2008 Server
Goto Forum:
  


Current Time: Thu Mar 28 14:42:14 CDT 2024