Questions tagged spring-boot

Explore the latest questions and answers asked by our top developers.

HttpOnly cookie generated on the server is present in Set-Cookie header but is not being saved while running locally

I have an Angular application with Spring boot in the backend. On the server side I generate an HttpOnly cookie, which is then to be saved. @CrossOrigin(origins = "*", allowedHeaders = "*", allowCredentials = "true") @GetMapping("token") public AuthenticationResponseDto generateToken( HttpServletResponse response) {"Creating token"); String username = "user"; String password = "pass"; authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(username, password)); […]

By techyyy
Categorized as angular, cookies, http, spring-boot, web Tagged , , , ,

how to use (WebAssembly) SharedArrayBuffer, if it will require cross-origin isolation?

Not sure this is the right place, but I would like to get some advice from you. I am implementing a web app, using microservices deployed in docker, then to get some data, I need to make requests to each microservices(different ports). My problem now is that I need to use WASM to paint in […]

How to secure my redirected link from Spring Boot?

I am using Spring Boot Security for authorization and authentication in my REST service. It uses database user data and sessionID cookie. In a Spring web controller I have a redirection to my Angular project site localhost:4200. @GetMapping("/admin") public void admin(HttpServletResponse httpServletResponse) throws IOException, MessagingException { httpServletResponse.setHeader("Location", "http://localhost:4200/"); httpServletResponse.setStatus(302); } Can I secure that site […]

By Hrvoje T
Categorized as angular, java, rest, spring, spring-boot Tagged , , , ,

How to enable HttpInterceptor

I have created httpInterceptor in backend SpringBoot and keeping my API key in I have to enable HttpInterceptor somewhere in Angular service in Http header but I dont know how I can do it Source: Angular Questions

Sending list of objects with MultipartFile field return 415 Unsupported Media Type

I’m trying to send list of objects to api (Spring Boot), where model has MultiPartFile field and description field, but server every time return me 415 Unsupported Media Type. I’m using Angular 9 on frontend to send data. My Java DTO object looks like: public class FooRequestDTO { private String description; private MultipartFile file; // […]

I am getting error 0 in Angular app if I enter from different pc in network

When I launch app from the pc that is hosted I can see the table. If I launch angular app from different pc in lan then I get error 0 in table. I saw that could be issue with CORS Java Spring Boot but I am new to it. In angular did ng server 192.168.xx […]

By Fitim
Categorized as angular, angularjs, java, spring, spring-boot Tagged , , , ,

Angular 11 Error Interceptor Ignores Http Request

I’m trying to implement authentication for an Angular(which I’m not very familiar with) app, here is a piece of code I have: the idea here is that I want to intercept error 403, refresh authentication token, and then resend the request. When the request to backend is sent, it creates an HttpOnly cookie that contains […]

By techrat
Categorized as angular, spring-boot, typescript Tagged , ,

Angular-Springboot Can’t map my File property to my MultipartFile property

I was following a tutorial where a dude sent a File to sbringboot and it got mapped correctly to a MultipartFile type like so: @PostMapping("/upload") public BodyBuilder uplaodImage(@RequestParam("imageFile") MultipartFile file) But I needed to modify the code to make the file a property, so I put it in my class public class FullAnnuncio { private […]

By santocielo99
Categorized as angular, java, json, spring-boot, typescript Tagged , , , ,

Angular : Get request Handling a Flux of ByteBuffer

I’m trying to develop a basic application that can play mp3 stored in S3 buckets using reactive programming in my backend @GetMapping(path="/{filekey}") public Mono<ResponseEntity<Flux<ByteBuffer>>> getFile(@PathVariable("filekey") String filekey) { GetObjectRequest request = GetObjectRequest.builder() .bucket(s3config.getBucket()) .key(filekey) .build(); return Mono.fromFuture(s3client.getObject(request,new FluxResponseProvider())) .map( (response) -> { checkResult(response.sdkResponse); String filename = getMetadataItem(response.sdkResponse,"filename",filekey);"[I65] filename={}, length={}",filename, response.sdkResponse.contentLength() ); return ResponseEntity.ok() .header(HttpHeaders.CONTENT_TYPE, […]

By davidvera
Categorized as angular, spring-boot, spring-webflux Tagged , ,

wrong total elements when using listJoin specification

I’m working with JPA CriteriaBuilder and specification for filtering data. This is just an illustrative example I have 3 tables (driver, car and type). a driver can drive many cars and each car has a type. I’m listing drivers with server side pagination and detailed search feature. I’m tring to get drivers by list of […]

By ayar anasse
Categorized as angular, spring-boot, spring-data-jpa Tagged , ,
1 57

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us