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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:36:03+00:00 2026-05-27T02:36:03+00:00

I am implementing a search functionality in a website I am building, which involves

  • 0

I am implementing a search functionality in a website I am building, which involves searching by the md5 hash of the name of the file submitted and searching by the notes associated with each submitted file. So, I should detect as to which button is pressed “Search by MD5” or “Search by Notes”. This is the code I have:

JSP code for the form:

<form id="search" name="search" action = "search.do"
        method="POST" enctype="multipart/form-data">
    <table align = "center">
        <tr>
            <th colspan="4" bgcolor="#004276"><font color="white">
                    Search for Sample 
            </th>
        </tr>
         <tr>
            <td><input name="md5" type="text" value="${form.md5}"/></td>
            <td><input name="md5search" type="submit" value="Search by MD5"/>
        </tr>
        <tr>
            <td><input name="notes" type="text" value="${form.notes}"/></td>
            <td><input name="notessearch" type="submit" value="Search by Notes"/>
        </tr>
    </table>
</form>

search.do is mapped to SearchResultsAction.java. Code in Java action class (SearchResultsAction) which handles the request is:

        if(request.getParameter("md5search").toString().equals("Search by MD5")){
            searchSubmissionsList = submissionsDAO.searchSubmissionsByMD5(form.getMD5());
        }

        if(request.getParameter("notessearch").toString().equals("Search by Notes")){
            searchSubmissionsList = submissionsDAO.searchSubmissionByNotes(form.getNotes());
        }

But the problem I am facing here is that, request.getParameter(“md5search”) and request.getParameter(“notessearch”) return null for some reason. I have been working on this for a while and have not been able to figure it out. The weird thing is that it once worked for me sometime back when I was working on another project. Am I missing something here?

  • 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-27T02:36:04+00:00Added an answer on May 27, 2026 at 2:36 am

    It’s null because you used multipart/form-data form encoding instead of (default) application/x-www-form-urlencoded. Basically, you have to (let Struts) extract the text fields from the multipart form data body the same way as you (or Struts) extracted the uploaded file. Or, as there is actually no <input type="file"> field in your form at all, just remove the enctype attribute altogether.

    See also

    • Does form with enctype="multipart/form-data" cause problems accessing a hidden field
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm implementing full text search functionality on my rap website , and I'm running
I'm implementing a search in my website, and would like to support searching for
I am confused with building the query. I am implementing the search feature in
I am facing a problem in implementing the search functionality in Table Views... Here
I am developing an android app which requires search functionality. My app contains action
I am implementing a search application. Corpus is large text documents. During file process
I am implementing Advanced Search kind of functionality for an Entity in my system
I am implementing search bar in my iphone app to apply searching on array
I am implementing search functionality in WinForms and I search by date range. Thus
In implementing faceted search, if the number of options is 7 or less, I

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.