//java.lang.NullPointerException at 
org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:792)..(UIBean 
fails when accessing tagNames Map in Map)
-----------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: WW-3062
                 URL: https://issues.apache.org/struts/browse/WW-3062
             Project: Struts 2
          Issue Type: Bug
          Components: Core Actions
    Affects Versions: 2.1.6
         Environment: (UIBean fails when accessing tagNames Map in Map)
TC 6.0.14
J2SE 1.6.10
Struts 2.1.6
            Reporter: Martin Gainty
            Priority: Minor


org.apache.struts2.components.UIBeans fails when accessing tagNames Map via 
parameters from evaluateParams

public void evaluateParams() {
.......
      //please read this caveat about using java.util.Map *from java.util.Map 
JavaDoc*
        //each key can map to at most ONE value.
        try
        {
        PageContext pageContext = ServletActionContext.getPageContext();
        java.util.ArrayList<String> tags=new java.util.ArrayList(50); //this 
will be the newly constructed List
        if (form != null )
        {
            addParameter("form", form.getParameters());
            if ( name != null )
            {
            // form.getParameters is a Map so you are accessing an inner Map in 
a Map?
            //    List tags = (List) form.getParameters().get("tagNames");
                         try
                         { //go straight  to Request ..pull the parameters via 
getParameterMap
               for (java.util.Iterator i = 
pageContext.getRequest().getParameterMap().values().iterator(); i.hasNext(); )
               {
                                     tags.add( i.next().toString() ); //this 
will be a live form-field tag
                           }
                     }
                     catch(java.lang.ArrayIndexOutOfBoundsException aie)
                     {    //prevent walk beyond the end
                                 System.out.println("ArrayIndexException has 
been produced message = "+aie.getMessage() );
                                 log.debug(aie.getMessage() );
                     }
//java.lang.NullPointerException at 
org.apache.struts2.components.UIBean.evaluateParams(UIBean.java:792)
//                tags.add(name);
            }
        }
            }
            catch(java.lang.NullPointerException npe1)
            {
                        System.out.println("Eating the exception in UIBean");
                        log.debug( npe1.getMessage() )
           }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to