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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:58:18+00:00 2026-05-21T22:58:18+00:00

I have one search widget where people search for car dealers by zip code.

  • 0

I have one search widget where people search for car dealers by zip code. There are also some optional checkboxes to refine search in that widget.

Here is the URI for searching dealer by zip code.

http://localhost:8080/dealer/zip/10080

If user selects checboxes then the URI will be

http://localhost:8080/dealer/zip/10080servicetype=type1&servicetype=type2&servicetype=type3

I am using jersey. Here is java code.

@Path("/dealer")
@Produces(MediaType.APPLICATION_JSON)
public class DealerLocatorRS {
    private DealerService dealerService=new DealerService();

    @GET
    @Path("/zip/{zip}")
    public List<Dealer> getByZip(@PathParam("zip") String zip, 
        @QueryParam("servicetype") List<String> servicetype){
    .. . ..
    }

Is this right approach to pass optional and multiple values and . Can anybody help me to apply best practices?

  • 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-21T22:58:18+00:00Added an answer on May 21, 2026 at 10:58 pm

    I’m not sure that I’d map a search for dealers in a particular zip code to a resource; it doesn’t feel quite right. Instead, I’d have a resource that lists all the dealers, with individual dealers being sub-resources of that. If it was possible to return a subset of the list of subresources restricted by properties (e.g., their zip code) then that would be a great way to implement a search, otherwise I’d have a separate search handler that returns a list of links to matching dealer resources.

    @Path("/dealer")
    public class Dealers {
        @GET
        public List<Dealer> getAll() { ... }
        @GET
        @Path("search/byZip")
        public List<URI> getByZip(@QueryParam("zip") String zip, ...) { ... }
        @Path("{dealerId:[^/]+}")
        public Dealer getDealer(@PathParam("dealerId") String id) { ... }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have below html code in one of the opensource project. <form action=/wiki/bin/view/Main/Search> <div
I have one boomarklet, means javascript code that takes current page's source, search for
I have one table view that should be filtered by values of search field
I have 6 text boxes on an asp page and one search button. Users
so here's the problem I have one form, it outputs search results after submit,
I have a search portal for school. And I am having one advance search
I have two controls on a page, one is a search entry and submission
I have search strings, similar to the one bellow: energy food olympics 2010 Terrorism
I have to search through a list and replace all occurrences of one element
I am using wordpress twentyten theme. and in this i have set search widget.

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.