Questions tagged [spring-rest]

Use this tag for question about the REST architectural style used in Spring framework

REST architectural style used in Spring framework

1305 questions
-1
votes
2 answers

Session in Spring REST using Spring boot

How Can I create session in Spring REST, Using Spring boot? I have ready application with REST APIs, now I just need to apply session in it. I have seen two ways for Spring REST and Spring Boot…
Sanjay Rabari
  • 2,091
  • 1
  • 17
  • 32
-2
votes
1 answer

@GetMapping check if the field exists - spring boot

I am creating a dynamic parameter rest api using spring boot and I would like to throw an exception if any field passed as parameter does not exist This is a get call using request parameters like this one: http://localhost:8080/action?prop1=a I…
fmezini
  • 17
  • 4
-2
votes
1 answer

REST API object conversion in java

I have request body of supplier in below format : { "supplier": { "supplierData": { "supplierAddress": { "street": "abc", "postCode": "1234", "city1": "abcd", "country": "DE", "region": "BW" …
nitin
  • 83
  • 1
  • 9
-2
votes
2 answers

SpringBoot: HttpClientErrorException$BadRequest: 400: [no body] when calling restTemplate.postforEntity or restTemplate.exchange

I am trying to hit a restful endpoint from my springboot application using restTemplate.exchange and restTemplate.postForEntity and I am getting 400 Bad request [no body] exception. I tried every possible solution to figure out the issue. From the…
Krishna Chaitanya
  • 2,533
  • 4
  • 40
  • 74
-2
votes
1 answer

Why am I getting 415 Unsupported Media Type in Spring MVC?

I'm getting the below error; I tried everything but not getting a resolution: HTTP Status 415 – Unsupported Media Type I am trying to send JSON object to the controller as put it in the @Requestbody <%@page import="org.json.JSONObject"%> <%@ page…
-3
votes
1 answer

Authentication failure for Spring boot endpoint

Here is the security configuration I am using @Configuration public class SpringSecurityConfiguration { @Bean public SecurityFilterChain getFilter(HttpSecurity http) throws Exception{ http.csrf().disable(); …
-3
votes
1 answer

Failed to determine a suitable driver class- Springboot 2.7.9

Description: Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
-3
votes
1 answer

How to Find subapths in url

URL url=new URL("http://www.google.com/stackoverflow/question"); OUPUT path1=stackoverflow, path2=question, ANOTHER URL url=new URL("http://www.google.com/stackoverflow/question/java"); OUTPUT path1=question path2=java If we enter dynamic url than…
-3
votes
1 answer

How to handle if @PatchMapping request is not valid

I am using PATCH for one of my REST api. PATCH expects an existing entry for which the request is being made. How to handle the scenario if the data for which the request is being made does not exist? I think an exception should be thrown if not…
RoyalTiger
  • 511
  • 2
  • 8
  • 27
-3
votes
1 answer

Implementing user authentication in Spring MVC rest api

I have built a basic crud spring mvc rest api and would like to add basic authentication for validating the user and adding login and logout. I have found a tutorial which covers spring mvc. I have tried implementing the basic authentication and the…
-3
votes
1 answer

JSON values to Java class conversion

I have a requirement where I have to create java classes for probable JSON response. So basically if I have, { email: 'email', password: 'pass' } I should create a java class like below, class Credentials { string email; string password; …
WebNoob
  • 237
  • 6
  • 16
-3
votes
1 answer

JSON response from spring REST controller

I am getting HTTP error code 406 with following error description: The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers. My Goal is to get my…
Ankit
  • 425
  • 1
  • 5
  • 21
-3
votes
1 answer

Integrate REST Web Services with Spring Integration

I have implemented Restful web services using spring technologies. Now, I need to integrate these services to work together on the same context using spring integration. How To make web services methods as endpoints ? How can I realize the…
houseem
  • 1
  • 2
-4
votes
1 answer

Which REST command to use for receiving data from payload, manipulating it, and returning the result?

I am really new to REST and that kinda stuff. I want to create a small service (using Java Spring - also new to me), which should resize an image in a few different ways. Currently, I have 0 clue on which REST command I should use for this. This is…
CodingTil
  • 447
  • 2
  • 16
-4
votes
1 answer

Here I get an error when I pass my DB name i.e Test if I pass Sid it works

import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class Main { public static void main(String[] args) throws Exception { Connection conn =…
Manju Badiger
  • 11
  • 1
  • 5
1 2 3
86
87