Frits,
I appreciate your reply and guidance.
Here is the brief summary of how this application works:
pricingUser.html
In this user(borrower of loan) enters the input field values of loan.
clicks on submit button
Upon submiting, this page invokes page1.jsp
Page1.jsp
This page post the input values of pricing.html to the gBean and calls method in gClass.
The gClass method does the calculation and determines the number of payments required to pay off
the loan based on input values entered in pricing.html.
After returning from the method this page forwards page2.jsp.
page2.jsp
This page creates dynamically (see on load tag of body of page2.jsp) input fields. The number of
input fields created depends on the number of payments computed (as described under page2.jsp
above.)
The user(borrower) has to enter the dollar amount in each of the displyed input fields
As you can we cannot post all input field values in one submit action. ( We have have two separate submits: one in pricingUser.html and one in page2.jsp). It uses page1.jsp, page2.jsp, page3.jsp and page4.jsp. I have three other functions in the same application whch requires only one submit button (in pricingSys.html. It uses page1.jsp and page4.jsp) These three functions works fine with request as scope but messes up.(see below for details)
Since user(borrower) has to enter dollar amount for each of the input payment fields we cannot
make it hidden on this page.
I was using session scope before changed over to request scope. I did this because it was messing
up the values within the session. Lets say I am processing pricing function and while it is still
running and/or just compeleted processing but I don't close the function (last page page4.jsp still
on diplay) and ran the pricing function again (simultaneously) While doing so the result output of one
mixes with the other one. So to get arround this problem I used request as scope. I don't know other
fancy way to get arround this mixing/cross over problem. The easiest way for me to get arround the
mixing/cross over problem was to change the scope from session to request.
Because of the above facts, I thought of the following:
1. Pass the gBean from page2.jsp to page3.jsp as a form input field(hidden) or part of URL and
extract it in page3.jsp and create class object from string gBean, perhaps as below: I prefer not
to use URL to pass because gBean has memory reference address (If passing URL is the easy way to
pass, I will use it as temporary fix.)
The code for creating object was borrowed from a University website:
http://www.rgagnon.com/javadetails/java-0351.html
I tried to run that as a stand alone code but it encounters some kind of problem at
the following code.
If you can make the attached standalone code to work that would be of great help.
2. To my understanding once the form action takes place (after click on submit button) in
page2.jsp the control moves to page3.jsp and there is no way to make the control to get back to
the point in page2.jsp following the submit button code (in page2.jsp). If it is possible I can
remove all lines of code below jsp:useBean in pag3.jsp and move them ot new page3a.jsp. In
otherwords only the following code will be in page3.jsp and the rest moved to new page3a.jsp.
Now this new page3a.jsp has to be somehow forwarded from page2.jsp at a point below the submit
button in page2.jsp. I think it not possible to use this approach to get arround the problem.
Here is summary of my questions:
1. Would you mind in looking in to it to figure out what the problem at the code line of CreateObject indicated above?
2. Do think it will work if we pass gBean from page2.jsp to page3.jsp and convert passed string gBean to gBean class object?
3. What is that I doing wrong in the following code that gives me null value of passed parameters.
It will be of great help if you can provide me the answer to the above three questions.
Thanks again
Prabhakar