Hi,

i have form in my jsp , which when submitted ,calls javascript which will inturn submit the form , this is working fine in IE. but when i submit from chrome , i get below error.

-version:2.5]] Servlet failed with IOException
weblogic.utils.NestedRuntimeException: Cannot parse POST parameters of request: '/integration/r5/wfsworklist/WFTaskUpdate'

        at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.parseQueryParams(ServletRequestImpl.java:2000)
        at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.getQueryParams(ServletRequestImpl.java:1894)
        at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.getParameter(ServletRequestImpl.java:1971)
        at weblogic.servlet.internal.ServletRequestImpl$RequestParameters.access$800(ServletRequestImpl.java:1809)
        at weblogic.servlet.internal.ServletRequestImpl.getParameter(ServletRequestImpl.java:796)
        at com.hp.omit.wfs.TaskUpdateFilter.doFilter(TaskUpdateFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)





<input type="SUBMIT" 
name="Update"
value="<%= Resource.getDisplayString(ResourceKeyConstants.LABEL_SAVEL_BUTTON_NAME, request.getLocale())%>" 
OnClick="callUpdate()"/>

and javascript --> 

 function callUpdate()
      {

       /* need to check to invoke the order item saving */
       var flag = document.getElementById("saveOrderItem");
       if( flag != undefined )
       {
          /* to reset the object before saving */
          callModifyXPath(0);
          /* to save the new object */
          callModifyXPath(1);
       }
      //validateing comment textArea.
        if(!validateTaskComment()){

          return;
        }
        var globalUpdateForm = document.forms['GLOBAL_UPDATE'];
        for(i = 0 ; i < document.forms.length ; i++)
         {
            var formObj = document.forms[i];
            var actionName = formObj.action;
            var formName = formObj.name;
            if(trim(formName) != 'GLOBAL_UPDATE' &&
               trim(formName) != 'PayloadJSPXML' )
            {
              if(trim(actionName) == 'WFTaskUpdate' ||
                 actionName.match('/WFTaskUpdate') != 'null')
              {
                for( j = 0 ; j < formObj.elements.length ; j++)
                {
                   var elemObj = formObj.elements[j];

                   var name = elemObj.name;
                   var value = elemObj.value;
                    var type = elemObj.type;

                    //CR11779 - Start                    
                    //alert("type::" + type+ " :: name ::" + name +" :: value ::" + value);            
                     if(type == "text" || type == "textarea"){
                         var errorInvalidChar="";
                         var read = elemObj.readOnly;

                        if(value != null && value!="" && !read){
                          var lastindexofField = name.lastIndexOf("_");
                          var fieldName =name.substring(lastindexofField+1, name.length) ;
                          errorInvalidChar =  validateControlChar(value, fieldName);
                           if(errorInvalidChar != ""){
                              alert(errorInvalidChar);   
                              elemObj.focus();
                              elemObj.select();
                              return;
                            }        
                         }
                     }
                   //CR11779 - end

                   //setElementValue(globalUpdateForm,name,value)
                   if(globalUpdateForm.elements[name] != null && name != "EmailMessage" )
                   {
                     globalUpdateForm.elements[name].value = value;
                   }
                 }
               }
             }
         }


        var amountLocalCurrency = document.GLOBAL_UPDATE.<%=PayloadFormGenerator.constructName(TaskformConstants.AMOUNTLOCALCURRENCY)%>;
        if((amountLocalCurrency != 'null') && (amountLocalCurrency != undefined))
        {
            if( ! validateFloat(trim(amountLocalCurrency.value)) )
            {
                     alert("Invalid format: Amount Local Curreny. Only number and dot are allowed.");
                    return;
            }
        }

        updateFlexFields();

        var assignmentWorkgroup = document.GLOBAL_UPDATE.<%=PayloadFormGenerator.constructName(TaskformConstants.ASSIGNMENTWORKGROUP)%>;
        if( assignmentWorkgroup != 'null' && assignmentWorkgroup != undefined )
        {
           if ( assignmentWorkgroup.value == null || assignmentWorkgroup.value == '') {
            alert ('Please select Local Team');
            return;
          }    
        }

        var fyiTeam1Elem = document.PayloadJSPHTML.fyiTeam1;        
        if((fyiTeam1Elem != 'null') && (fyiTeam1Elem != undefined))
        {   
            var fyiTeam2Elem = document.PayloadJSPHTML.fyiTeam2;
            var fyiTeam3Elem = document.PayloadJSPHTML.fyiTeam3;
            if(fyiTeam1Elem.options.length > 1 || fyiTeam2Elem.options.length > 1 || fyiTeam3Elem.options.length > 1)
            {        
                if(fyiTeam1Elem.selectedIndex == 0 && fyiTeam2Elem.selectedIndex == 0 && fyiTeam3Elem.selectedIndex == 0)
                {            
                  alert('Please select FYI Team');
                  return;
                }                           
            }  
        }


        globalUpdateForm.submit();
      }

With jsp what I'm expecting is jsp and Java code, this is pure Javascript. Is it possible you haven't pasted the right code?

yeah this is pure java script , but the control doesnt come to actionservlet java code , the logs which we pasted above is from weblogic server logs , not the application logs . i can paste the java code also , have put logger statements in doGet method , but cant see them in application logs ...

  public TaskFormUpdate() {
  }

  public void init(ServletConfig config)
          throws ServletException
      {
          super.init(config);
      }

      public void doPost(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException
      {
          doGet(request, response);
      }

      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException
      {
            long start = System.currentTimeMillis();
            String user = "";

            //System.out.println("<====================================Inside TaskFormUpdate================================================>");
            String errorMessage = null;
            String errorStackMessage = null;
            request.setCharacterEncoding("UTF-8");
            response.setContentType("text/html; UTF-8");
            /*rem oricode
            String updateComment = request.getParameter("UpdateComment");
            String addURL = request.getParameter("AddURLAttachment");
            String updateAll = request.getParameter("UpdateAll");
            String updatePayload = request.getParameter("UpdatePayload");
            String deleteAttachment = request.getParameter("DeleteAttachment");
            String uploadAttachment = request.getParameter("UploadAttachment");
            String getAttachment = request.getParameter("QueryAttachment");
            String taskAction = request.getParameter(Constants.BPM_TASKACTION_ACTION_KEY_NAME);
            */
            String updateComment = null;
            String addURL = null;
            String updateAll = null;
            String updatePayload = null;
            String deleteAttachment = null;
            String uploadAttachment = null;
            String getAttachment = null;
            String taskAction = null;
            String logString="";
            String action = "";
            try
            {
               /**
               * ASTA CR#4355 by Shahreen
               */
              updateComment = WebInspect.getWebInspect(request,"UpdateComment");
              addURL = WebInspect.getWebInspect(request,"AddURLAttachment");
              updateAll = WebInspect.getWebInspect(request,"UpdateAll");
              updatePayload = WebInspect.getWebInspect(request,"UpdatePayload");
              deleteAttachment = WebInspect.getWebInspect(request,"DeleteAttachment");
              uploadAttachment = WebInspect.getWebInspect(request,"UploadAttachment");
              getAttachment = WebInspect.getWebInspect(request,"QueryAttachment");
              taskAction = WebInspect.getWebInspect(request,Constants.BPM_TASKACTION_ACTION_KEY_NAME);           
              /**
               * ASTA end
               */
              logger.info("Task payload-----" +"before if loops" );
                createAndValidateSessionStore(request);
                //CR9248[S]
                IWorkflowContext wfCtx = getContext(request);
                if(wfCtx!=null){
                  logger.info("Task payload-----" +"context if loops" );
                  user = wfCtx.getUser();
                }
                if(updateComment != null && !updateComment.equals("")){
                  logger.info("Task payload-----" +"comment if loops" );
                    updateComment(request);
                    action = updateComment;
                }else
                  if(addURL != null && !addURL.equals("")){
                    logger.info("Task payload-----" +"addurl if loops" );
                      addURLAttachment(request);
                      action = addURL;
                  }else
                    if(deleteAttachment != null && !deleteAttachment.equals("")){
                            deleteAttachment(request,deleteAttachment); //Changed for CR9508 to handle DELETE button issue
                            action = deleteAttachment;
                    }else
                      if(uploadAttachment != null && !uploadAttachment.equals("")){
                              uploadAttachment(request);
                              action = uploadAttachment;
                      }else
                        if(updatePayload != null && !updatePayload.equals("")){
                                updatePayload(request);
                                action = updatePayload;
                        }else
                          if(updateAll != null && !updateAll.equals("")){

                            logger.info("Task payload-----" +"inside update  all if loop" );
                          //  logger.info("Task payload-----request" + request.toString());
                                  updateAllWFTask(request);
                                  action = updateAll;
                          }else
                            if(taskAction != null && !taskAction.equals(""))
                            {
                                updateTaskAction(request, response);
                                action = taskAction;
                                return;
                            }
                logString = "Action = "+action+", User = "+user+", Task Number = "+request.getParameter("parentTaskNumber")+", Time = ";
            //CR9248[E]
            }catch(Exception exc){
                logger.error("TaskFormUpdate",exc);
                errorStackMessage = getStackTrace(exc);
                log("error page . jsp");
                log(errorStackMessage);
                errorMessage = exc.getMessage();
            }
            if(getAttachment == null || getAttachment.equals("")){
                log ("get attachment");
                redirectPage(request, response, errorMessage);
            }
        logger.info(logString+(System.currentTimeMillis()-start)+" ms." + " pooranhp");
      }
      }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.