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.

  • 相关阅读:
    数据结构八树和森林
    数据结构 七 二叉树的遍历
    python 的 encode 、decode、字节串、字符串
    TCP/IP
    pg 数据库操作
    nginx + lua 的 跳转命令
    lua string 下的函数
    lua 的匹配规则
    nginx的 ngx.var ngx.ctx ngx.req
    docker 网络模式 和 端口映射
  • 原文地址:https://www.cnblogs.com/xiaotaoliang/p/111368.html
Copyright © 2011-2022 走看看