Swastik Dey wrote:In you jsp you have something like. What does this mean?
request.getAttribute("userList")!=""
You probably want to make sure that the list not empty?
Problem 2, you are initializing the arraylist inside the loop
So what happens in the above code, every time the loop executes a new arraylist object is created, means it will always store only the last record in the array list. Initialize it before you start the loop.
Piyush Mangal wrote:I believe you know how to debug the code. You can easily dubug the issue yourself and see if dispatcher.forward(request,response) is being called.
as it can't take value from previous page//String str = request.getParameter("P_ID");
String nextJSP = "/editUser.jsp";
RequestDispatcher dispatcher = request.getRequestDispatcher(nextJSP);
dispatcher.forward(request,response);
Swastik
Swastik Dey wrote:
You should first initialize userList, then do the condition checking. But you need to know one thing that using scriptlets in jsp is not a recommended approach. Jsp is just your view, try to use jstl/el/custom tags etc.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:Megha, I've asked you before in https://coderanch.com/t/571565/JDBC/java/error-missing-values to remove all the trailing spaces from your code. I had to again fix two of your posts in this thread to fix the forum layout. Can you please try to remove all those trailing spaces yourself from now on? Thanks.
Swastik Dey wrote:Just for a test, try to forward to some other page may be test.jsp, without using any attributes, and see how it behaves.
Swastik Dey wrote:Just for a test, try to forward to some other page may be test.jsp, without using any attributes, and see how it behaves.
Megha Singhal wrote:
Rob Spoor wrote:Megha, I've asked you before in https://coderanch.com/t/571565/JDBC/java/error-missing-values to remove all the trailing spaces from your code. I had to again fix two of your posts in this thread to fix the forum layout. Can you please try to remove all those trailing spaces yourself from now on? Thanks.
sorry but i didn't get about which trailing spaces you are talking , i mean where
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:
Megha Singhal wrote:
Rob Spoor wrote:Megha, I've asked you before in https://coderanch.com/t/571565/JDBC/java/error-missing-values to remove all the trailing spaces from your code. I had to again fix two of your posts in this thread to fix the forum layout. Can you please try to remove all those trailing spaces yourself from now on? Thanks.
sorry but i didn't get about which trailing spaces you are talking , i mean where
Inside your latest two servlet code tags, the last line had several dozen spaces between the final } and the code end tag. I have since removed those extra spaces.
Swastik Dey wrote:Just for a test, try to forward to some other page may be test.jsp, without using any attributes, and see how it behaves.
Consider Paul's rocket mass heater. |