zoukankan      html  css  js  c++  java
  • help on IlegalStateException 关于 HttpServletRequest.getParameterMap()

    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

    Posted by: Marco Wang on April 28, 2003 in response to Message #80975 0 replies in this thread

    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.

  • 相关阅读:
    [HDU] 2084 数塔 入门dp
    一些实用的小技术,不定时更新^_^
    上传图片的综合验证
    一个典型web接口处理
    js控制背景音乐播放
    心开始平和起来
    冲突域广播域
    可怜的我的啊~~
    祈祷
    昨夜小楼又东风...
  • 原文地址:https://www.cnblogs.com/xiaotaoliang/p/111368.html
Copyright © 2011-2022 走看看