hi,

i use Hidden in client-side

Hidden hidden = new Hidden(name, value);

server-side in do-post:

DiskFileItemFactory factory = new DiskFileItemFactory();
ServletFileUpload upload = new ServletFileUpload(factory);
response.setCharacterEncoding("UTF-8");

            List<FileItem> items = null;
            try
            {
                items = upload.parseRequest(request);
            }
            catch (FileUploadException e)
            {
                LOG.warn(".........", e);
            }
// if(items!=null..................)
for(FileItem item : items)
                {
                   // add code, what you want can like this coming
code
                   //  item.getName()   item.getString()
item.getString("UTF-8")  item.getFieldName()
                }

maybe help you!






On 1月15日, 下午10时59分, Alex Luya <alexander.l...@gmail.com> wrote:
> I have following code to upload an image to server and I need servlet
> to rename image to what the value of a hidden field sended to server
> through a post method, the question is how to get the value of this
> hidden field:imageStoreName.is it to use request.getParameter
> ("imageStoreName")?I tried it,but I got  null.
> private final void setUploader()
>         {
>                 HorizontalPanel hpUploaderLayout = new HorizontalPanel();
>                 // hidden will tell server how to rename the image
>                 imageStoreName = new Hidden();
>                 imageStoreName.setID("imageName");
>                 imageStoreName.setValue(Util.getId());
>
>                 final FileUpload uploader = new FileUpload();
>                 ........
>
>                 hpUploaderLayout.add(imageStoreName);
>                 hpUploaderLayout.add(uploader);
>                 uploadForm.setWidget(hpUploaderLayout);
>         }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to