Hello,
 
I need to add parameters to request object.
 
MyFaces includes a non-modifiable (immutable) RequestParameterMap class to wrap parameter map from ServletRequest.
Hence it is not possible to add parameters using 
        facesContext.getExternalContext().getRequestParameterMap()
 
there is another way to do this
        HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest();
        request.getParameterMap().put("objectID" "value1");
 
But this causes the type of "objectID" parameter and its value to be native string "[Ljava.langString" instead of "java.lang.String" 
 
So the parameter can NOT be retrieved by its name (specified as String literal)  i.e. '#{param.objectID}'
Caused by: javax.faces.el.EvaluationException: Cannot get value for _expression_ '#{param.objectID}'
 at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:397)
 at org.apache.myfaces.config.impl.digester.elements.ManagedProperty.getRuntimeValue(ManagedProperty.java:122)
 at org.apache.myfaces.config.ManagedBeanBuilder.initializeProperties(ManagedBeanBuilder.java:157)
 at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:55)
 at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:311)
 at org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVariable(ValueBindingImpl.java:569)
 at org.apache.commons.el.NamedValue.evaluate(NamedValue.java(Compiled Code))
 at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java(Compiled Code))
 at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:378)
 ... 88 more
Caused by: javax.faces.el.EvaluationException: org.apache.myfaces.context.servlet.RequestParameterMap
 at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:78)
 at org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:532)
 at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java(Compiled Code))
 at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:378)
 ... 96 more
Caused by: java.lang.ClassCastException: java.lang.String
 at com.ibm.ws.webcontainer.srt.SRTServletRequest.getParameter(SRTServletRequest.java:715)
  at org.apache.myfaces.context.servlet.RequestParameterMap.getAttribute(RequestParameterMap.java:39)
  at org.apache.myfaces.context.servlet.AbstractAttributeMap.get(AbstractAttributeMap.java:87)
  at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:67)
 ... 99 more
Thanks
 

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

Reply via email to