Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8452571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:32:04+00:00 2026-06-10T11:32:04+00:00

I get parameters from client with java servlet. This is my post: For sending

  • 0

I get parameters from client with java servlet.
This is my post:

enter image description here

For sending the request to the server I use ExtJs:

var x = new Ext.Window({
                                title:'Загрузка файла',
                                items:[
                                    formp = new Ext.FormPanel({
                                        fileUpload: true,
                                        width: 350,
                                        autoHeight: true,
                                        bodyStyle: 'padding: 10px 10px 10px 10px;',
                                        labelWidth: 70,
                                        defaults: {
                                            anchor: '95%',
                                            allowBlank: false,
                                            msgTarget: 'side'
                                        },
                                        items:[{
                                            xtype:"combo",
                                            fieldLabel:'Тип файла ',
                                            name:"cb_file",
                                            id:"cb_file",
                                            mode:"local",
                                            typeAhead: false,
                                            loadingText: 'Загрузка...',
                                            store:new Ext.data.SimpleStore({
                                                fields: ['file_name', 'file_type'],
                                                    data : [['*.MIF/MID', 'mif'],['*.GPX', 'gpx']]
                                                }),
                                            forceSelection:true,
                                            emptyText:'выбирите тип...',
                                            triggerAction:'all',
                                            valueField:'file_type',
                                            displayField:'file_name',
                                            anchor:'60%'
                                        },{
                                            xtype: 'fileuploadfield',
                                            id: 'filedata',
                                            emptyText: 'Выберите файл для загрузки...',
                                            fieldLabel: 'Имя файла',
                                            buttonText: 'Обзор'
                                        }],
                                        buttons: [{
                                            text: 'Загрузить',
                                            handler: function(){
                                                mapinfo="mapinfo";
                                                    formp.getForm().submit({
                                                        url: url_servlet+'uploadfile',
                                                        //params: {file_type: mapinfo},
                                                        success: function(formp, o) {
                                                            alert(o.result.file);
                                                            alert(o.result.success);
                                                            kad_tab.getStore().reload()
                                                            zoom_store.load();
                                                            }
                                                    })
                                            }
                                        }]
                                    })
                                ]   
                             })
                             x.show();

If I understand this correctly: after sending 2 parameters to the server cb_file and filedata. I try to get them by:

String st = request.getParameter("cb_file");

But get null.

When I try to get the file:

list = upload.parseRequest(request);

I get null as well.
But if I send only the file (for this i delete lines with combobox) it works fine.
How to parse this request?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T11:32:05+00:00Added an answer on June 10, 2026 at 11:32 am

    That´s because the request is a multipart one. You can read the request stream and parse it for yourself or use the Apache Commons (use this one please!).

    Here you have a sniplet that ilustrate how to do what you want to do with Apache Commons fileupload:

    // Process the uploaded items
    List items = upload.parseRequest(request);
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
        FileItem item = (FileItem) iter.next();
    
        if (item.isFormField()) {
            processFormField(item);
        } else {
            processUploadedFile(item);
        }
    }
    

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get parameters from a PUT request using HttpServlet#doPut: public void doPut(HttpServletRequest request,
I want to make queries according to the parameters I get from my server
From my JSP, I am sending a GET request with a parameter called jobDetails
I have setup a java servlet which accepts parameters from the URL and have
I am trying to extract the GET parameters from a ZF REST URL. It's
The thing is that I want to get parameters for my Capistrano recipe from
Normally I would just use URL GET parameters but CodeIgniter doesn't seem to like
Usually when I get POST data it's send from a HTML form and the
I have successfully implemented this from android to a java httpservlet on google app
My question is very similar to Java: HTTP Post to create new "Product" in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.