Hi,
I'm trying to create a servlet class that will remember the previous web page, so that when a person logs in, it will remember the last page that he/she was in.
The way it's done is that every time the user goes on a web page it will store the page with variables (like parameters in a HashMap) in a session.
However, the problem comes when trying to get the variables out of the cache and putting it in the request.getParameterMap.put(key,value) cos i get an the following problem:
java.lang.IllegalStateException: Cannot find message associated with key 'parameterMap.locked'
at org.apache.catalina.util.ParameterMap.put(ParameterMap.java:212)
Any suggestions/solutions would be most appreciated.
Thanks
Yogesh
help on IlegalStateException
Please check ServletRequest's Java doc, the Map returned from an getParameterMap() is immutable:
"an immutable java.util.Map containing parameter names as keys and parameter values as map values. The keys in the parameter map are of type String. The values in the parameter map are of type String array."
You just can't call "put" on that.