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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:25:02+00:00 2026-05-30T00:25:02+00:00

I’ve a class as shown below: @Path(/myrequest) @Scope(request) @Component public class MyRESTCode implements IServicedResource<T>

  • 0

I’ve a class as shown below:

@Path("/myrequest")
@Scope("request")
@Component
public class MyRESTCode implements IServicedResource<T> {   
@Inject
private IMyService serviceImpl;

@Override
public void setServiceImpl(IMyService impl) {
    serviceImpl = impl;
}
}

@Path("/users")
@POST
@Consumes ({MediaType.APPLICATION_JSON})
@Produces ({MediaType.APPLICATION_JSON})
public Response mymethod(Object obj) throws Exception {
       serviceImpl.callme(obj);
       return Response.noContent().build();
}

Now, this callme method implementation exists in some other class (MyOtherClass.java).

Can any one tell me how mymethod invokes callme method in MyOtherClass.java, when /users POST request is made???

Also, who calls setServiceImpl method & how does it get set & when does it get called?

Thanks!

  • 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-30T00:25:04+00:00Added an answer on May 30, 2026 at 12:25 am

    You must be having a spring applicationContext.xml which should look something like

    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns: xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="
                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
                http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
    
           <context:component-scan base-package="test.example"/>
           <context:annotation-config/>
    
    </beans>
    

    In this xml, if you notice that base-package should be defined as a package where your controller class (in your case MyRESTCode.java) should be present. Spring will search for classes annotated as @Component and configures them at the path mentioned by @Path

    When you hit the a post request with JSON in the body to the URL …./myrequest/users, the callme method gets invoked which in turn invokes your service method.

    @Inject annotation tells spring that dependency of IMyService should be injected to serviceImpl variable through the setter method setServiceImpl.

    Hope this helps.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.