Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Member
Posts: 1
Registered: ‎04-27-2011
My Device: Curve 8520
My Carrier: Vodafone

HTTP POST Method becomes GET Method

Hi Experts,

 

I'm new to BB development so have probably missed something obvious.....but.....I've developed a simple HTML Form that tries to submit data to a backend server (I've posted the whole HTML chunk at the end).

 

When I launch the form on a desktop browser (IE) it works just fine, I can happily process the submitted data.  But when I render it via my BB Curve in the IE browser, it renders fine, but when I submit, it ignores the POST method and instead submits with a GET method.  There is no form data in the query string unfortunately. 

 

Does anyone have any idea why the page doesn't work with the BB interface but is ok with the Desktop (IE in both cases)?

 

Thanks in advance,

Andy

 

----------------------------------

 

<!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">
 
  <head>
      <title>My Title</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <meta name="CCODE" content="ACL" />
      <meta name="FTYPE" content="TPS1" />
      <meta name="FVER"  content="00" />
      <meta name="FLANG" content="E" />
     
      <!--Fetch scripts-->
      <base href=http://ref01.w4.local:8000/bc/bsp/z_myref />
      <link rel="stylesheet" type="text/css" href="AG_Style.css" />           
  </head>
 
  <body>
      <form   method="post"
              target="_self"
              enctype="multipart/form-data" 
              action="http://ref01.w4.local:8000/bc/bsp/z_html_viewer/start.do" >
             
         <input id="flm_formid" type="hidden" name="flm_formid" value="{#FID#}" />
         <input id="flm_fidvar" type="hidden" name="flm_fidvar" value="{#FIDVAR#}" />    
         <input id="flm_return" type="hidden" name="flm_return" value="" />     
              
           <p>
              <span class="caption">Name</span>
                <input  type="text"
                      name="I_NAME"
                     class="field" />
           </p>
         
           <p>
              <span class="caption">Comments</span>
                <input  type="text"
                      name="I_COMMENTS"
                     class="field" />
           </p>

         <input name="Submit" type="submit" class="button" id="SubmitButty" value="Submit" />
    
      </form>
  </body>
</html>

 

Contributor
Posts: 14
Registered: ‎11-22-2011
My Device: Bold 9790
My Carrier: wifi

Re: HTTP POST Method becomes GET Method

[ Edited ]

Hi,

 

I have a similar issue when rendering forms with field2.BrowserField, with the following devices:

- BlackBerry Bold 9790 7.0.0.344

- BlackBerry Curve 9380 7.0.0.482

- BlackBerry Curve 9360 7.0.0.244

 

This works fine with blackberry browser.

 

Every POST forms processed by a webview (net.rim.device.api.browser.field2.BrowserField) are turning to GET and lose all parameters.

 

Reproduced with :

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN"
    "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>
<body>
    <form method="post" action="http://10.0.10.3:8091/formulaire/testFormulaire.do" enctype="application/x-www-form-urlencoded">
        <div>
            <input type="hidden" name="testfield" value="ok"/>
            <input type="submit"/>
        </div>
    </form>
</body>
</html>

 

Or even:

<html>
<body>
    <form method="post" action="http://10.0.10.3:8091/formulaire/testFormulaire.do">
        <input type="hidden" name="testfield" value="ok"/>

        <input type="submit">
    </form>
</body>
</html>

 

Request log from server:

22 nov. 2011 15:45:56 org.apache.catalina.core.ApplicationContext log
INFO: Request Received at 2011-11-22 15:45:56.439
 characterEncoding=null
     contentLength=-1
       contentType=null
            locale=en
           locales=en
          protocol=HTTP/1.1
        remoteAddr=10.0.11.64
        remoteHost=10.0.11.64
            scheme=http
        serverName=10.0.10.3
        serverPort=8091
          isSecure=false
---------------------------------------------
       contextPath=
            header=host=10.0.10.3:8091
            header=connection=close
            header=accept-language=en_US,en
            header=user-agent=Mozilla/5.0 (BlackBerry; U; BlackBerry 9790; en) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.344 Mobile Safari/534.11+
            method=GET
          pathInfo=null
       queryString=null
        remoteUser=null
requestedSessionId=null
        requestURI=/formulaire/testFormulaire.do
       servletPath=/formulaire/testFormulaire.do
=============================================

Any idea?

Contributor
Posts: 14
Registered: ‎11-22-2011
My Device: Bold 9790
My Carrier: wifi

Re: HTTP POST Method becomes GET Method

Sorry, my problem was due to incorrect usage of ProtocolController.

ProtocolController has different behaviors : handleNavigationRequest() calls handleResourceRequest() for recent devices, and it was not the case for older devices.

Highlighted
Retired
Posts: 518
Registered: ‎07-18-2011
My Device: Bold
My Carrier: Rogers

Re: HTTP POST Method becomes GET Method

Does that mean the issue is solved?



1.Please resolve your thread by clicking the "Accept as Solution" button below the post which solved your problem!
2. If any post helps you please click the button below the post(s)