On 1/19/07, Gary VanMatre <[EMAIL PROTECTED]> wrote:
>From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>
>
> The request attribute works fine. I made a mess. But I am still
> interested how I can set a
> parameter und its value within a bean method.
>
Consider:
public void actionListener(ActionEvent event) {
FacesContext context = FacesContext.getCurrentInstance();
Map params = context.getExternalContext
().getRequestParameterMap();
params.put("myparam", "value");
One minor problem ... this (or the solutions below) will not work, because
the map returned by getRequestParameterMap() is immutable -- it cannot be
changed. In turn, this restriction comes from the fact that request
parameters are read only at the servlet API level ... you cannot change
them.
If you want to pass dynamically calculated information for this request to
some other part of the application, use request *attributes* instead.
Craig
// or
ValueBinding vb = context.getApplication().createValueBinding("#{
param.myparam}");
vb.setValue(context, "value");
// or
params = (Map)
context.getApplication().getVariableResolver().resolveVariable(context,
"param");
& nbsp;& nbsp; params.put("myparam", "value");
}
Gary
> ----Ursprüngliche Nachricht----
> Von: [EMAIL PROTECTED]
> Datum: 19.01.2007 15:51
> An:
> Betreff: Access to param
>
>
> Hello
>
> Can I set a request parameter in the action listener? Thanks for
> Your help.
> I tried it with a request attribute, but I think this does not
> work
>
> Urs
>
>
>
>
>
>
>
>
>
> Show category
> /overview.jsp
>
> category< /FROM- OUTCOME>
> /category.jsp
>
>
>
>
>
>
>