struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Lee" <mle...@hotmail.com>
Subject Re: set a value from a form to a form
Date Wed, 11 Sep 2002 13:58:46 GMT
?I haven't used hidden fields in over 4 years and have never had a problem.
You definately have to be careful with what you stick in the session, I
agree. I don't think it makes the app less scaleable as long as you use a
session object responsibly.  I've been using sessions since they've been
around and have never had a problem. I like the end user to see as little as
possible when it comes to controlling variables. I make an exception when I
want to give them access to something pertinent (the URL for mapquest is a
good example). This is a potential security hole (of which I have been able
to take advantage of before, not maliciously of course, just as a matter of
curiosity).

You can get the value you need from your form bean out of the request. The
problem is you lose scope unless you put it in the session. The more I think
about it the more I'm realising it's either the session or a hidden field
because there is no way to get data between requests outside of those
mechanisms. A request is just that, a request per page....
hmmm...
So it's session if you don't want the user to see anything or hidden fields
if you don't want to put the data in the session for some reason.
thanks, I've always just stuck this stuff in the session but I may have a
valid case for a hidden field.
Mike

----- Original Message -----
From: "John Yu" <john@scioworks.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Wednesday, September 11, 2002 3:21 AM
Subject: Re: set a value from a form to a form


> Mike,
>
> Using hidden fields is the general practice as it allows you to
> "distribute" the conversation state of the session to the clients and
makes
> your app more scalable.
>
> Use session with care. You need to consider multi-threading and
> concurrent-request issues if the data is stored in the session.
>
>
> At 02:15 pm 11-09-2002, you wrote:
> >You do understand me! :)
> >I use a hidden field now. I was trying to get away from that though so
the
> >user will not see it. I may have to put it in the session.
> >Any ideas?
> >thanks,
> >Mike
> >
> >----- Original Message -----
> >From: "John Yu" <john@scioworks.com>
> >To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> >Sent: Tuesday, September 10, 2002 10:09 PM
> >Subject: Re: set a value from a form to a form
> >
> >
> > > Mike,
> > >
> > > If I understand you correctly, you want to retain the value when the
form
> > > is submitted. One option is to use <bean:message> to display the value
and
> > > use <html:hidden> to retain the value for form submission.
> > >
> > > <html:form ...>
> > >    Prop1: <bean:message name="myForm" property="prop1"/>
> > >    <html:hidden name="myForm" property="prop1"/>
> > >    ...
> > > </html:form>
> > >
> > > The value is *not* retained in a bean. It's just resubmitted as an URI
> > > parameter. If you let Struts do the auto formbean population, you will
get
> > > it in the actionform object.
> > >
> > > Bean created by <bean:define> in the request scope will "disappear"
> >because
> > > whenever you submit the form, that's a complete new request.
> > >
> > >
> > > At 06:36 am 11-09-2002, you wrote:
> > > >I have a form object that populates html fields. The problem is, I
want
> >to
> > > >display some of the form data and have it uneditable. When I submit
the
> > > >form loses all the data that is not in an html:.. tag.
> > > >I've tried...
> > > >     <bean:define id="userRole" name="userForm" property="userRole"
> > > > scope="request" toScope="request"/>
> > > >but this doesnt seem to work
> > > >thanks,
> > > >Mike
> > >
>
> --
> John Yu                       Scioworks Technologies
> e: john@scioworks.com         w: +(65) 873 5989
> w: http://www.scioworks.com   m: +(65) 9782 9610
>
> Scioworks Camino - "Don't develop Struts Apps without it!"
> Copyright (c) 2002 John Yu/Scioworks Technologies. All rights reserved.
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>

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


Mime
View raw message