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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:17:09+00:00 2026-06-19T03:17:09+00:00

I have a working REST setup using JERSEY. I need almost identical functionality for

  • 0

I have a working REST setup using JERSEY. I need almost identical functionality for a different set of entities. What do I need to do to clone this current functionality?

@Path("/will")
public class FileResource {

private final BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
private final BlobInfoFactory blobInfoFactory = new BlobInfoFactory();

/* step 1. get a unique url */

@GET
@Path("/url")
public Response getCallbackUrl() {
  /* this is /_ah/upload and it redirects to its given path */
  String url = blobstoreService.createUploadUrl("/rest/will");
  return Response.ok(new FileUrl(url), MediaType.APPLICATION_JSON).build();
}

/* step 2. post a file */

@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void post(@Context HttpServletRequest req, @Context HttpServletResponse res) throws IOException, URISyntaxException {
  Map<String, BlobKey> blobs = blobstoreService.getUploadedBlobs(req);
  BlobKey blobKey = blobs.get("files[]");
  res.sendRedirect("/rest/will/" + blobKey.getKeyString() + "/meta");
}

....

Can I simply duplicate this class and change will to something else?

  • 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-19T03:17:11+00:00Added an answer on June 19, 2026 at 3:17 am

    There is nothing magical about Jersey, you can superclass as usual. For example:

    public class BaseResource
    {
    
      @GET
      @Path("/url")
      public Response getCallbackUrl() {
        // Default code goes here
      }
    }
    
    @Path("/will")
    public class WillResource extends BaseResource
    {
      // Overrides go here
    }
    
    @Path("/abc")
    public class AbcResource extends BaseResource
    {
      // Overrides go here
    }
    

    This will give you responses for /will/url and /abc/url

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

Sidebar

Related Questions

I am using WCF and REST, and I have complex types, which are working
I have all my rewrite rules setup and working in .htaccess but I need
I have working WCF REST web service and can set status codes and status
I'm trying to build an app using Jersey, Rest, Tomcat, c3p0 etc. I have
I have working code of js, it shows different div for selected option. <html>
Have been working on this question for a couple hours and have come close
I am writing a WCF service, (json REST) and I have it working fine
I'm working on a REST application with Spring-data Hibernate etc.. I've setup all my
I have the jQuery UI Autocomplete setup to my liking and working perfectly, but
I'm working on a Java REST server serving an iPhone app. Now we have

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.