You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by zuban <al...@gmail.com> on 2007/04/25 14:50:25 UTC

Newbie. validate Inputs. Request-Attribute lost

Hi,
I have in a form a list of Options (optionsCollection). The object (a
java.util.List) which holts the values for the optionsCollection is in the
request-scope.
When submitting the form and an error occurs in the validate-methode of the
Form-Bean, the form-jsp-page appears again (of course), but there isn't the
object to fill the optionsCollection any more.
What coult I do? I don't want to set the object in der session-scope.
-- 
View this message in context: http://www.nabble.com/Newbie.-validate-Inputs.-Request-Attribute-lost-tf3645135.html#a10180005
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Newbie. validate Inputs. Request-Attribute lost

Posted by zuban <al...@gmail.com>.
hmm, it is set in the same manner but isn't available in the Form-Bean. For
testing I have printed out all Request-Attributes in the Form-Bean in this
way:
------------------------------
Enumeration e = request.getAttributeNames();
        while (e.hasMoreElements()) {
        	System.out.println(e.nextElement());
        }
--------------------
 but there is no "userDetail".



Hafeez-ur Rehman wrote:
> 
> Hi,
> 
> Set the userDetail as the same manner in validate as you set it in action.
> 
> -----Original Message-----
> From: zuban [mailto:allan345@gmail.com] 
> Sent: Wednesday, April 25, 2007 7:50 PM
> To: user@struts.apache.org
> Subject: RE: Newbie. validate Inputs. Request-Attribute lost
> 
> 
> thanks for answer
> 
> I have the same issue with another request-object and I' have done your
> sugestion:
> 
> In the form-jsp-page a have put this scripplet:
> <% request.setAttribute("userDetail", request.getAttribute("userDetail"));
> %>
> 
> Now, the form-bean shoult access the object "detailUser" in this way:
> request.getAttribute("userDetail");
> but the return of this methode is null ??
> 
> 
> Hafeez-ur Rehman wrote:
>> 
>> Hi,
>> 
>> Your previous request is finished and the request level optionsCollection
>> attribute also washed out. After the failure of validate method, you need
>> to
>> set it again "optionsCollection" as request attribute if you don't want
>> to
>> make is session level attribute.
>> 
>> Hafeez
>> 
>> -----Original Message-----
>> From: zuban [mailto:allan345@gmail.com] 
>> Sent: Wednesday, April 25, 2007 5:50 PM
>> To: user@struts.apache.org
>> Subject: Newbie. validate Inputs. Request-Attribute lost
>> 
>> 
>> Hi,
>> I have in a form a list of Options (optionsCollection). The object (a
>> java.util.List) which holts the values for the optionsCollection is in
>> the
>> request-scope.
>> When submitting the form and an error occurs in the validate-methode of
>> the
>> Form-Bean, the form-jsp-page appears again (of course), but there isn't
>> the
>> object to fill the optionsCollection any more.
>> What coult I do? I don't want to set the object in der session-scope.
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/Newbie.-validate-Inputs.-Request-Attribute-lost-tf3645
>> 135.html#a10180005
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Newbie.-validate-Inputs.-Request-Attribute-lost-tf3645
> 135.html#a10182050
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Newbie.-validate-Inputs.-Request-Attribute-lost-tf3645135.html#a10187097
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Newbie. validate Inputs. Request-Attribute lost

Posted by Hafeez-ur Rehman <ha...@numetrics.com>.
Hi,

Set the userDetail as the same manner in validate as you set it in action.

-----Original Message-----
From: zuban [mailto:allan345@gmail.com] 
Sent: Wednesday, April 25, 2007 7:50 PM
To: user@struts.apache.org
Subject: RE: Newbie. validate Inputs. Request-Attribute lost


thanks for answer

I have the same issue with another request-object and I' have done your
sugestion:

In the form-jsp-page a have put this scripplet:
<% request.setAttribute("userDetail", request.getAttribute("userDetail"));
%>

Now, the form-bean shoult access the object "detailUser" in this way:
request.getAttribute("userDetail");
but the return of this methode is null ??


Hafeez-ur Rehman wrote:
> 
> Hi,
> 
> Your previous request is finished and the request level optionsCollection
> attribute also washed out. After the failure of validate method, you need
> to
> set it again "optionsCollection" as request attribute if you don't want to
> make is session level attribute.
> 
> Hafeez
> 
> -----Original Message-----
> From: zuban [mailto:allan345@gmail.com] 
> Sent: Wednesday, April 25, 2007 5:50 PM
> To: user@struts.apache.org
> Subject: Newbie. validate Inputs. Request-Attribute lost
> 
> 
> Hi,
> I have in a form a list of Options (optionsCollection). The object (a
> java.util.List) which holts the values for the optionsCollection is in the
> request-scope.
> When submitting the form and an error occurs in the validate-methode of
> the
> Form-Bean, the form-jsp-page appears again (of course), but there isn't
> the
> object to fill the optionsCollection any more.
> What coult I do? I don't want to set the object in der session-scope.
> -- 
> View this message in context:
>
http://www.nabble.com/Newbie.-validate-Inputs.-Request-Attribute-lost-tf3645
> 135.html#a10180005
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/Newbie.-validate-Inputs.-Request-Attribute-lost-tf3645
135.html#a10182050
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Newbie. validate Inputs. Request-Attribute lost

Posted by Dave Newton <ne...@yahoo.com>.
--- zuban <al...@gmail.com> wrote:
> In the form-jsp-page a have put this scripplet:
> <% request.setAttribute("userDetail",
> request.getAttribute("userDetail"));
> %>
> 
> Now, the form-bean shoult access the object
> "detailUser" in this way:
> request.getAttribute("userDetail");
> but the return of this methode is null ??

You're setting the attribute in the request with the
current value of the attribute in the request?

d.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Newbie. validate Inputs. Request-Attribute lost

Posted by zuban <al...@gmail.com>.
thanks for answer

I have the same issue with another request-object and I' have done your
sugestion:

In the form-jsp-page a have put this scripplet:
<% request.setAttribute("userDetail", request.getAttribute("userDetail"));
%>

Now, the form-bean shoult access the object "detailUser" in this way:
request.getAttribute("userDetail");
but the return of this methode is null ??


Hafeez-ur Rehman wrote:
> 
> Hi,
> 
> Your previous request is finished and the request level optionsCollection
> attribute also washed out. After the failure of validate method, you need
> to
> set it again "optionsCollection" as request attribute if you don't want to
> make is session level attribute.
> 
> Hafeez
> 
> -----Original Message-----
> From: zuban [mailto:allan345@gmail.com] 
> Sent: Wednesday, April 25, 2007 5:50 PM
> To: user@struts.apache.org
> Subject: Newbie. validate Inputs. Request-Attribute lost
> 
> 
> Hi,
> I have in a form a list of Options (optionsCollection). The object (a
> java.util.List) which holts the values for the optionsCollection is in the
> request-scope.
> When submitting the form and an error occurs in the validate-methode of
> the
> Form-Bean, the form-jsp-page appears again (of course), but there isn't
> the
> object to fill the optionsCollection any more.
> What coult I do? I don't want to set the object in der session-scope.
> -- 
> View this message in context:
> http://www.nabble.com/Newbie.-validate-Inputs.-Request-Attribute-lost-tf3645
> 135.html#a10180005
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Newbie.-validate-Inputs.-Request-Attribute-lost-tf3645135.html#a10182050
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Newbie. validate Inputs. Request-Attribute lost

Posted by Hafeez-ur Rehman <ha...@numetrics.com>.
Hi,

Your previous request is finished and the request level optionsCollection
attribute also washed out. After the failure of validate method, you need to
set it again "optionsCollection" as request attribute if you don't want to
make is session level attribute.

Hafeez

-----Original Message-----
From: zuban [mailto:allan345@gmail.com] 
Sent: Wednesday, April 25, 2007 5:50 PM
To: user@struts.apache.org
Subject: Newbie. validate Inputs. Request-Attribute lost


Hi,
I have in a form a list of Options (optionsCollection). The object (a
java.util.List) which holts the values for the optionsCollection is in the
request-scope.
When submitting the form and an error occurs in the validate-methode of the
Form-Bean, the form-jsp-page appears again (of course), but there isn't the
object to fill the optionsCollection any more.
What coult I do? I don't want to set the object in der session-scope.
-- 
View this message in context:
http://www.nabble.com/Newbie.-validate-Inputs.-Request-Attribute-lost-tf3645
135.html#a10180005
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org