0

I am sending two values by using Query string using both jsp and servlet pages.

  1. I need to taking only one value from query string in jsp page working fine.

  2. At the same time in servlet page when i click button i need to get the value from query string but here i am not getting the value from query string.

  3. which value is i need to took in jsp that value only it visible remaining value is appear in servlet page.
  4. how can i retrieving query string values in my servlet

In jsp i am using query string at the text box value code:

<input type="text" id="txtBatchName" name="txtBatchName" value="<%=request.getParameter("BatchId").replace("id=","")%>">  

Servlet page:

if(request.getParameter("btnUpdate")!= null){
String Batch2=request.getQueryString();
String Id1=request.getParameter("Id");
}

1 Answer 1

1

Try with name attribute.(Id is specific to Java Script and it wont be transmitted to server side)

String Id1=request.getParameter("txtBatchName");
Sign up to request clarification or add additional context in comments.

2 Comments

No, In my query string having both Id and BatchId but i need BatchId in jsp and Id value in servlet page
Can you post your HTML Form ? id parameter cannot serialize by html itself to the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.