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

  • Home
  • SEARCH
  • 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 8999507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:11:22+00:00 2026-06-16T00:11:22+00:00

I have a requirement from a user to have a web page where they

  • 0

I have a requirement from a user to have a web page where they can perform CRUD operations on a list of users stored in a DB.
It will be hosted on Tomcat.
I threw a quick Servlet together that takes 5 parameters from the request and creates a userName in the DB with this data. Now I want to allow the user the ability to enter a username and click a button and if this username exists in the db then it will be returned and the page populated to allow the user perform some edits on the data.
My question is, should I just create a new Servlet for this data lookup service or somehow shoe horn the required functionality into the existing servlet that creates usernames in the DB

  • 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-16T00:11:23+00:00Added an answer on June 16, 2026 at 12:11 am

    I don’t think it’s unreasonable to put this functionality in the same servlet. You’re operating on the same resources (db) and the functionality is inter-related, so putting it in the same functional component makes sense.

    I’d start to pull functionality into a different servlet when you’re doing something fundamentally different e.g. operating on different databases, or there’s some requirement to deploy that functionality separately (e.g. booking sales vs. browsing information), or you need to apply servlet filters differently for different components.

    To answer your question below, you need to somehow distinguish between the different operations. Options include:

    1. Modifying the URL path e.g. http://example.com/entity/update vs http://example.com/entity/delete. You can inspect the request path in your servlet
    2. Provide an operation parameter e.g. http://example.com/entity?operation=delete&…

    The first example could be trivially handled by providing different servlets mapped on different paths. However I think the overhead of providing those servlet and mappings outweighs the ease of simple checking the request path.

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

Sidebar

Related Questions

I have a requirement to allow users to open word document from web page
I have a web page that has a requirement to allow users to paste
I have got a requirement from a client. They need three blogging web application
We have a requirement where the web page displays all the records from joining
I have a requirement to pass credentials from one Microsoft .NET Web Application to
I have an ambitious requirement for an asp.net 2.0 web page that contains a
I have a requirement where I want images to be stored/retrieved from a single
I have an ASP.NET web site that will use Active Directory to store Users.
I have a requirement for an ASP.NET web application whereby the same user is
I have the requirement that the end-user can change localized resources and the changes

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.