Thanks for all the suggestion guys..

Here is some more elaboration of the problem in steps:

1) First user select a file to upload .. I am using FormFile type variable
in my formbean.

<html:file name=*"Form"* tabindex=*"11"* property=*"attachment"* styleId=*
"frmTxtAttachment"* style=*"width:300px"*

 value=*"<bean:write name='parecRequestForm' property='attachPath'  />"*></
html:file>
here attachPath is FormFile type property in my formbean.

2) On submitting the form I did some check before committing the data into
db.

3) On the basis of the check result of #2 I come back to the same page and
display a popup of OK and CANCEL.

    But this time as form has refreshed <html:file>'s value gets empty.
(This is the main problem) whereas values
    for rest of the properties remains filled up as struts tags reads that
forms value which is in request.

4) Now on clicking OK from this popup I resubmit the form but this time as
attachment file path is emptied so it
doesn't get saved in the db.

I am looking for the suggestions provided but it doesn't look working in
this scenario. Can you guys please give
a glimpse this problem and suggest something.

Every help is very much appreciated..

Thanks and Regards,
--
Vivek Mishra


On Sat, May 21, 2011 at 12:01 AM, Chris Pratt <thechrispr...@gmail.com>wrote:

> Good call, I focused on the wrong part of the question, i.e. why the value
> that was presented to the browser was wrong, not why the value wasn't being
> used by the browser.
>   (*Chris*)
>
> On Fri, May 20, 2011 at 9:30 AM, Jason Pyeron <jpye...@pdinc.us> wrote:
>
> >
> > > -----Original Message-----
> > > From: Chris Pratt [mailto:thechrispr...@gmail.com]
> > > Sent: Friday, May 20, 2011 12:21
> > > To: Struts Users Mailing List
> > > Subject: Re: Unable to add value in <html:file>
> > >
> > > I must have missed the automated upload requirement
> > > somewhere, so no you would definitely not want people to be
> > > able to randomly grab files of anyone's machine without user
> > > interaction.  The closest you're likely to get is Flash or an
> > > Applet (like Dave suggested).
> > >   (*Chris*)
> >
> > While the OP did not ask for an "automated" upload, the only reason for
> > providing a value for the path, is so the end user does not have to
> change
> > it
> > before the submit. Lets call that semi automatic.
> > As such a browser may disregard any value put there... It has been a
> while
> > since
> > I dealt with these issues.
> >
> > >
> > > On Fri, May 20, 2011 at 5:17 AM, Jason Pyeron
> > > <jpye...@pdinc.us> wrote:
> > >
> > > > > -----Original Message-----
> > > > > From: Dave Newton [mailto:davelnew...@gmail.com]
> > > > > Sent: Friday, May 20, 2011 7:35
> > > > > To: Struts Users Mailing List
> > > > > Subject: Re: Unable to add value in <html:file>
> > > > >
> > > > > Why would the container matter? Isn't this a browser issue?
> > > > >
> > > >
> > > > Remember the file path is required to be ignored, so an automated
> > > > upload of files like /etc/shadow or c:\windows\win.ini,
> > > etc. can not
> > > > be uploaded without user intervention. Even an applet (and
> > > maybe some
> > > > activeX controls) cannot access the "unrestricted" file
> > > system unless
> > > > they have been "trusted".
> > > >
> > > > Googling the rest is your best solution, some keywords to
> > > get you started:
> > > >
> > > > automatic file upload
> > > >
> > > > And then one of ...
> > > >
> > > > applet Firefox html http IE javascript jsp php
> > > >
> > > > You should be able to get the idea from that.
> > > >
> > > > > Dave
> > > > >  On May 20, 2011 12:31 AM, "Chris Pratt"
> > > > > <thechrispr...@gmail.com> wrote:
> > > > > > Depending on what container you're using, you might try:
> > > > > >
> > > > > > <html:file name="Form" tabindex="11" property="attachment"
> > > > > > styleId="frmTxtAttachment" style="width:300px"
> > > > > > value="${parecRequestForm.attachPath}" />
> > > > > >
> > > > > > (*Chris*)
> > > > > >
> > > > > > On Thu, May 19, 2011 at 9:04 AM, vivek mishra
> > > > > <mishravive...@gmail.com
> > > > > >wrote:
> > > > > >
> > > > > >> Hi list,
> > > > > >>
> > > > > >> I am trying to add some value in <html:file> but
> > > unable to do this.
> > > > > >>
> > > > > >> Here is my code:
> > > > > >> <html:file name=*"Form"* tabindex=*"11"*
> > > property=*"attachment"*
> > > > > styleId=*
> > > > > >> "frmTxtAttachment"* style=*"width:300px"*
> > > > > >>
> > > > > >> ** value=*"<bean:write name='parecRequestForm'
> > > > > property='attachPath'
> > > > > >> />"*
> > > > > >> ></html:file>
> > > > > >>
> > > > > >> I am getting value in *<bean:write name='parecRequestForm'
> > > > > >> property='attachPath' /> , but it's not getting set in*
> > > > > >>
> > > > > >> *as as value of <html:file>.*
> > > > > >>
> > > > > >> *Any help will be much appreciated !!*
> > > > > >>
> > > > > >> *Thanks and Regards,*
> > > > > >>
> > > > > >> *-- Vivek Mishra*
> > > > > >>
> > > > > >> * *
> > > > > >>
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> > > > -                                                               -
> > > > - Jason Pyeron                      PD Inc. http://www.pdinc.us -
> > > > - Principal Consultant              10 West 24th Street #100    -
> > > > - +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
> > > > -                                                               -
> > > > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> > > > This message is copyright PD Inc, subject to license 20080407P00.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > > > For additional commands, e-mail: user-h...@struts.apache.org
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> > -                                                               -
> > - Jason Pyeron                      PD Inc. http://www.pdinc.us -
> > - Principal Consultant              10 West 24th Street #100    -
> > - +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -
> > -                                                               -
> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> > This message is copyright PD Inc, subject to license 20080407P00.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>

Reply via email to