Parameter passing error

Posted on 2004-11-04
Last Modified: 2010-04-01
Hi all,

What wrong with the code below? I  get payLoadType=null in my bandwidth_process.jsp.

<% String payLoadType=request.getParameter("payload");

<META HTTP-EQUIV="Refresh" CONTENT="0; URL=/bandwidth_test/bandwidth_process.jsp?payLoadType="+<%=payLoadType %>>
Question by:jen2483
    LVL 8

    Accepted Solution

    initially when this page is accessed payload will be null and that is what is being set in the URL for your Meta refresh and so in your bandwidth_process.jsp you are getting null.
    LVL 3

    Assisted Solution

    URL=/bandwidth_test/bandwidth_process.jsp?payLoadType="+<%=payLoadType %>

    You should pass the parameter in the URL with the name payload.
    request.getParameter("payload") will get the parameter named "payload", you are sending it with the name "payLoadType"

    Should be: URL=/bandwidth_test/bandwidth_process.jsp?payload="+<%=payLoadType %>

    Or: <% String payLoadType=request.getParameter("payLoadType");
    LVL 6

    Assisted Solution

    Hi jen

    How are you getting the 'payload' parameter onto this page ??....

    In the previous page from where you are getting the payload parameter try doing ...


    and now in this bandwidth_process.jsp page do

    <% String payLoadType= (String)request.getSession().getAttribute("payload");
          request.getSession().setAttribute("payload" ,null);
    LVL 5

    Assisted Solution

    There are few possibilities of getting payload request variable as null.
    1. If you are coming from other page to this (current) page your previous page seems that it does not have payload object whose value you are trying to get.

    2. If this is your base page that means you are not posted to this page from any other page then initially the payload object will have null, which is quite obvious too because till unload this page at the client machine the payload object is not been defined.

    Please check if the payload object is defined property before you actully accessing it value.

    NOTE: In my comment the object is refer to any valid HTML objects as textbox, button, hidden...

    I hope it helps you.


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now