Re: [Stripes-users] stripes:hidden malfunction ?

Subject:   Re: [Stripes-users] stripes:hidden malfunction ? (find more)
From:   Tim Fennell <hidden> (find more)
Date:   Dec 22, 2005 10:35

Hey Lukas,

Right now there is no way to do what you want to do with the Stripes  
hidden field tag.  But, I think the simplest solution by far would  
just be to use a non-stripes hidden field.  The Stripes tags follow a  
strict re-population strategy that accepts the first non-null value  
found in the following order:
 - HttpRequest parameters
 - ActionBean properties
 - Default values on the JSP

But it sounds like what you're doing doesn't really need any of the  
"value-add" properties of the stripes:hidden tag like auto-
repopulation under error etc.  More like you just want it to always  
hold a specific value from a bean in request scope.  In that case I'd  
just write:
 <input type="hidden" name="foo" value="${foo}"/>
and leave it at that.  Will this work for you?

-t

On Dec 22, 2005, at 8:48 AM, Lukas Vlcek wrote:

> Hi,
>
> I am experiencing strange behavior of stripes:hidden tag. I am not
> sure if this is a bug or correct behavior, anyway here is the problem
> description:
>
> I have a form on my JSP with hidden input foo. I populate its value
> from javascript (form.foo.value = 'XYZ';) and then I call
> form.submit().
>
> Thus request with URL parameter foo=XYZ is created and sent to action.
>
> In action I get value of foo and then I reset foo (setFoo("")) and
> store *empty* foo value in request. Then forward to JSP. It is
> important to note that it is the same/original JSP.
>
> In JSP I have something like
> <c:out value="${foo}"/>
> <stripes:hiddne name="foo" value="${foo}">
>
> It is clear that there is still URLparameter foo=XYZ in the request.
> However foo value stored in request score is empty (which I proved by
> <c:out value="${foo}"/>) but hidden input does not reflects that and
> it takes the value from URL parameter. So the hidden input value of
> foo is still XYZ which I don't think is correct.
>
> Interestingly, I found that if there is <stripes:hiddne name="foo"
> value="dummy"> in JSP and this JSP is called with foo URL parameter
> (again it can be foo=XYZ), then this hidden value is overriden. It
> results to <input type=hidden name='foo' value='XYZ'> instead of
> <input type=hidden name='foo' value='dummy'>.
>
> This seems very confusing to me.
>
> Is there any way how make stripes:hidden tag reflect the real value of
> request scoped ${foo} instead of foo=XYZ URL parameter?
>
> Regards,
> Lukas
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through  
> log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD  
> SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
> _______________________________________________
> Stripes-users mailing list
> hidden
> https://lists.sourceforge.net/lists/listinfo/stripes-users



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Stripes-users mailing list
hidden
https://lists.sourceforge.net/lists/listinfo/stripes-users
Entire Thread (Showing 3 of 11)

  • [Stripes-users] stripes:hidden malfunction ? Lukas Vlcek <hidden>

    Hi, I am experiencing strange behavior of stripes:hidden tag. I am not sure if this is a bug or correct behavior, anyway here is the problem description

    • Re: [Stripes-users] stripes:hidden malfunction ? Tim Fennell <hidden>

      • Re: [Stripes-users] stripes:hidden malfunction ? Lukas Vlcek <hidden>

        Tim, Using plain old html hidden input tag should work I think. I was so stripes centric that I didn't think of using other possibilities :) Thanks for tip, I'll give it a try (8 more messages in this thread)