Struts: losing session attributes while redirecting

Hello everyone,

while redirecting from one action to another, I'm losing some attributes that were in session scope. Maybe anyone would help me figure out why?

On my first action, I have:

session.setAttribute("itevenList",itevenList);

session.setAttribute("prod",addDelUpdItevenForm.getProduto());

return mapping.findForward("success");

if I check here, before the return, both parameters have its values correctly setted.

But then I redirect it to a second action where I have:

prod = (String) request.getSession().getAttribute(prod);

produto = ProdutoService.getInstance().getProduto(prod);

My attribute from the session comes null. The funny thing is that if I check the other value I had put on the session (itevenList) it is there correctly!

My config is:

<action

path="/AddItevenPedidoList"

type="auge.action.AddItevenPedidoListAction"

name="addDelUpdItevenForm"

scope="session"

parameter="action"

validate="true"

input="/pages/pedido/produtoPedidoDados.jsp">

<forward name="success" path="/DadosProduto.do"/>

<forward name="corInvalida" path="/pages/pedido/produtoPedidoDados.jsp"/>

<forward name="error" path="/Error.do"/>

<forward name="naoLogado" path="/NaoLogado.do"/>

</action>

Can anyone help me figure out?

Thanks

[1918 byte] By [Super_Moonstera] at [2007-10-2 9:58:16]
# 1

Not sure if this was just a typo or not -

>

> > prod = (String)

> d = (String)

> request.getSession().getAttribute(prod);

> produto =

> produto =

> = ProdutoService.getInstance().getProduto(prod);

>

In request.getSession().getAttribute you are passing in a String variable called prod. At least, according to what is shown here.

bpapa2000a at 2007-7-17 0:03:39 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...