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.

  • 相关阅读:
    HashMap 和HashTable
    两种方式获得键盘录入
    打印流 printStream
    对象操作流--存储对象
    内存输出流
    序列流
    装饰设计模式
    递归
    IO流(使用指定的码表读写字符)
    IO-字符流 练习
  • 原文地址:https://www.cnblogs.com/xiaotaoliang/p/111368.html
Copyright © 2011-2022 走看看