Questions tagged spring

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

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 , , , ,

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 , , , ,

How to obtain the access token from Angular through server log API in JAVA?

The server logging API will be consumed from java. How can I get the access token from the request header in Java spring boot application? Source: Angular Questions

By StackUser94
Categorized as angular, java, nxlog, spring, spring-boot Tagged , , , ,

Captcha session null

Good afternoon programmers, I would need your help. I have a backEnd working in java and generating a captcha image working perfectly according to the code below: @RestController public class CaptchaControler { private static final String FILE_TYPE = "png"; @ResponseStatus(HttpStatus.OK) @RequestMapping(method=RequestMethod.GET, value="/api/captchaWS", produces = MediaType.APPLICATION_JSON_VALUE) public void gerarCaptcha(HttpServletRequest request, HttpServletResponse response) { CaptchaService captchaService = […]

By Pedrojdi
Categorized as angular, captcha, session, spring Tagged , , ,

Angular does not call spring rest services running on the same server

I have one Java dynamic web project, in this project I have rest service and angular web application both. My index.html page is located on "WebContent" folder. My web.xml code is below <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="" xmlns:xsi="" xsi:schemaLocation="" version="3.0"> <display-name>GCSC</display-name> <servlet> <servlet-name>gcsc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>gcsc</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <session-config> <session-timeout>30</session-timeout> </session-config> <welcome-file-list> […]

By Zapp
Categorized as angular, spring, spring-boot Tagged , ,

How to maintain consistent Angular versions when using ( Spring Boot + Angular ) hybrid projects structure?

As stated above, I have a couple of projects built with Spring + Angular architecture. It was all going smoothly when we started, but once I started updating Angular versions to keep it current, things started getting complicated; the usual dependencies angular cli / core/ material design, etc were causing issues. I was thinking of […]

Cannot deserialize value of type `java.time.LocalDateTime` from Object value (token `JsonToken.START_OBJECT`)

i try to send date from angualr material into my database using spring boot, i got this error JSON parse error: Cannot deserialize value of type java.time.LocalDateTime from Object value (token JsonToken.START_OBJECT); nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type java.time.LocalDateTime from Object value (token JsonToken.START_OBJECT) this how i get Date in angualr {reporterDate: […]

By starw
Categorized as angular, spring, spring-boot Tagged , ,

Missing "Access-Control-Allow-Origin" header after a POST request with a 302 response

I’m using the login form integrate to Spring, and when the authentification is correct, the server respond with a 302 request to the /user path as Location. The problem is that the client (Chrome) don’t want to send the GET request to /user because the header "Access-Control-Allow-Origin" is missing. But if I do the GET […]

By CanardNocturne
Categorized as angular, spring Tagged ,

Angular 12 Data table not showing data until i use modal

I have an "error", if in my menu.component.ts i dont add this.getEmployee(1); on my ngOnInit() , the table looks empty until i press edit button and then suddenly all the information appears on the table. I don’t want to use that "bad smell code" so i want to know what am i doing wrong. Thanks […]

By Ernest T
Categorized as angular, crud, spring Tagged , ,

Dependency Injection via Abstract class/Interface to an Array in Angular

In Spring, we have a useful feature where we can get the instances of all the implementations of an Interface in a List. The code for that is like below: public interface Vehicle { void runs(); } @Component public class Car implements Vehicle { public void runs(){ // some implementation } } @Component public class […]

By sam
Categorized as angular, spring, typescript Tagged , ,
1 28

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