Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8716677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:08:35+00:00 2026-06-13T06:08:35+00:00

I have a jsp file where I send two parameters using the following url.

  • 0

I have a jsp file where I send two parameters using the following url.

var url = 'abc_user_history.jsp?where='+where+'&stock_number=' + StockNumber;
window.open(url, 'Special_Value_History','toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,width=1500,height=900');

Here I am only getting stock_number, where is always null… in where I have some SQL query, ex:

where=where stock_id like '4575%' and stock_name like 'abc%'

In the abc_user_history.jsp I always has where as null. However I am able to get stock_number value. Please suggest how to pass that where value…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:08:38+00:00Added an answer on June 13, 2026 at 6:08 am

    So many anti-patterns here i don’t know where to start 😐

    If you really need your where parameter to be one single, dynamic parameter,
    you can pass a String with all the pairs field=value separated by a custom separator,
    and then parse them in Java (using a StringTokenizer) and mount them in a Where condition in the Action.

    Example of where variable:

    where=”stock_id:::’4575%’;;;stock_name:::’abc%’;;;”
    (::: means that the field name is over and its starting the value, ;;; means that that pair is over and you are eventually starting to read a new pair).

    of course this will break if some of your values contains “;;;” or “:::” (you should sanitize them first with javascript).

    By the way, this is not good because you shouldn’t concat your java mounted string to the query string, but inject your tokenized values in a PreparedStatement (so the PreparedStatement will check and sanitize them for you).

    But i suggest to pass every parameter as a single parameter (not a ?where= but a ?stock_id=xxx&stock_name=yyy&… in your URL).

    And you should use POST to post a form, not GET that should only be used to read pages, not to post stuff (not possible using window.open(), but you can post a form from an anchor with target=”_blank” and onclick=”javascript:document.getElementById[‘myForm’].submit();”)

    Hope that helps…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a web project using jsp, I have following requirement Upload a file (say
I have a jsp file: validate.jsp- var rollNo=document.forms[result_form][studentRollno].value; var name=document.forms[result_form][studentName].value; $(#student_result).load(result.jsp?rollNo=+rollNo+&name=+name); As you can
I have a .jsp file that receives a request and checks the request's parameters.
I have the following in jsp: <form action=/ucReady2/uploadservlet method=post enctype=multipart/form-data> <label for=filename_1>File: </label> <input
I have a jsp file in the root of .war file. and then I
I'm getting an exception when i have my jsp file on the webserver, it
I have these in a jsp file. But these values are not updated in
In my .jsp file I have the code below. How can I compare the
I have hard-coded data into a .jsp file. What I want to do is
so i have a .js file that 2 different jsp pages call. .js file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.