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 6875551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:20:42+00:00 2026-05-27T04:20:42+00:00

I´m trying to catch the next two highlighted fields in a servlet where I

  • 0

I´m trying to catch the next two highlighted fields in a servlet where I can get the uploaded file.

The source code is just the same as which is shown in a GWT FormSubmit class Javadoc

form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);

// Create a panel to hold all of the form widgets.
VerticalPanel panel = new VerticalPanel();
form.setWidget(panel);

// Create a TextBox, giving it a name so that it will be submitted.
final TextBox tb = new TextBox();
tb.setName("WorkTitle");
tb.setValue("WorkTitle");

panel.add(tb);

// Create a ListBox, giving it a name and some values to be associated
// with
// its options.
ListBox lb = new ListBox();
lb.setName("listBoxFormElement");
lb.addItem("foo", "fooValue");
lb.addItem("bar", "barValue");
lb.addItem("baz", "bazValue");
panel.add(lb);

// Create a FileUpload widget.
FileUpload upload = new FileUpload();
upload.setName("uploadFormElement");
panel.add(upload);

// Add a 'submit' button.
panel.add(new Button("Submit", new ClickListener() {
    public void onClick(Widget sender) {
        form.setAction(GWT.getModuleBaseURL()+"uploadWork");
        form.submit();
    }
}));

I´m getting these parameters with this code lines in my servlet:

protected void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
    System.out.println("ENTRAA BIENNNN");
    System.out.println(" ___ELEMENTO1" + req.getAttribute("WorkTitle"));
    System.out.println(" ___ELEMENTO3" + req.getParameterValues("WorkTitle"));

But both returns me NULL.

How could I do?

TIA!

  • 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-05-27T04:20:42+00:00Added an answer on May 27, 2026 at 4:20 am

    Most servlet containers do not decode multipart/form-data automatically, so req.getParameter (or getParameterValues or similar getters) won’t return anything.
    You’ll have to use a library such as Apache Commons FileUpload, or Jetty’s MultiPartFilter to decode multipart/form-data payload.

    As a side note, req.getAttribute has nothing to do with getting data out of the request; it’s used to pass data, related to a request, between server components (between the servlet container and servlets, or between a filter and a servlet, for instance)

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

Sidebar

Related Questions

I'm having a bit of a play around with IIS7, just trying to catch
I am trying to get the bold text next to the hour scheldule (
I'm trying to get a pic just made it with the cam with the
trying to get length of file which from local storage. File exists 100% (because
I'm trying to catch a ClassCastException when deserializing an object from xml. So, try
I'm trying to catch a double-click event in a TreeView's empty area to create
I'm trying to catch an event when a user clicks a blank space on
Hi I am am trying to catch mouse movements for a MouseOver function in
In C++, I'm trying to catch all types of exceptions in one catch (like
Im working on a response filter. Im trying to catch all expresion: $sometext.sometext$ with

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.