in Education by
I am trying to implement the Hateoas using spring boot. In my UserController class i have used the below code @GetMapping("/users/{id}") public Resource retrieveUser(@PathVariable int id) { User user = service.findOne(id); Resource resource = new Resource(user); ControllerLinkBuilder linkTo=linkTo(methodOn(this.getClass()).retrieveAllUsers()); I am getting a compile time error on line where i am using the - methodOn(). Compiler is not able to find the methodOn using the controller link builder. I have used the below import to implement hateoas import org.springframework.hateoas.mvc.ControllerLinkBuilder.*; JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Methods you are using here are static, so to use them you need access using class reference unless you import them using static imports. See more details here

Related questions

0 votes
    This is my code it's just starting the scan but it is not completing ,where is the error in it. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I have the below query to fetch specific columns of a entity/table from database @Query("SELECT u.email, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I am a number I am not an odd number I am higher than 90 I am not higher than 100 If you subtract me from 100, you get nothing. What number am I?...
asked Feb 13, 2021 in Education by JackTerrance
0 votes
    The below image shows my question in detail: it works when client version is changed to 5 beta but ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I am a beginner and I just need a bit of help on why I getline is showing an error: this is what I have so far ... payments[MAX_ITEMS]; ifstream iFile; if ( argc != 2 ) { cout...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I am a beginner and I just need a bit of help on why I getline is showing an error: this is what I have so far ... payments[MAX_ITEMS]; ifstream iFile; if ( argc != 2 ) { cout...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I am trying to consume this API for dart using Flutter: https://pixcut.wondershare.com/api.html. My ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 6, 2022 in Education by JackTerrance
0 votes
    Here's the code: ''' file_path = (r'C:\Users\Luka\Desktop\Pyhton exercises\pi_digits.txt') with open( ... file_object: print(line) Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    Heyy mates..Am an icse student can anyone tell me any importance for java please its urgent I have my exam ... please for icse java. Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    I am new to React but I know main concept of unique key. However, I am getting a warning. Below ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    I tried to implement Ngrx into my Angular Application, but sadly haven't been able to retrieve any data. ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I am trying to inflate one of my fragments. However, the fragment does not show up in the autosuggest ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    we're have a client that needs to get interactive messages from a server, from clients that are distributed ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    Our clients are frequently reporting issue that they are getting "Access Denied" exception when they used to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 3, 2022 in Education by JackTerrance
...