Questions tagged java

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

Connection to the Web Socket

I try to connect to web socket from angular to spring boot with SockJS: I have errors after connection to the server’s sockets : Spring Boot configuration: @Override public void configureMessageBroker(MessageBrokerRegistry config) { config.enableSimpleBroker( "/"); config.setUserDestinationPrefix("/user"); // config.setApplicationDestinationPrefixes("/user"); } @Override public void registerStompEndpoints(StompEndpointRegistry registry) { registry.addEndpoint("/ws") .setAllowedOrigins("http://localhost:4200") .setHandshakeHandler(new UserHandshakeHandler()) .withSockJS(); } @Override public boolean configureMessageConverters(List<MessageConverter> […]

By Dmitry Bogomaz
Categorized as angular, java, sockjs, spring, websocket Tagged , , , ,

How to make this angularjs run

The code below cannot use Local Storage even though in the previous project it worked fine. And I can’t tell why. cart.js: const app = angular.module(‘shopping-cart-app’,[]); app.controller(‘shopping-cart-ctrl’,function($scope){ $scope.cart = { items:[], add(id){ var item = this.items.find(item => item.productID == id); if(item){ item.qty++; this.saveToLocalStorage(); }else{ $http.get(`/rest/products/${id}`).then(resp =>{ = 1; this.items.push(; this.saveToLocalStorage(); }).catch(error =>{ console.log("Error",error) }) […]

Spring Boot error 403 when sending request

My system consists of 3 parts. Spring Boot app, Angular app and Android app. When my Android app sends request to reset password (if don’t remember it) then Spring Boot app receives this request with this method: @PostMapping("/forgot_password") public String processForgotPassword(@RequestBody String email, HttpServletRequest request) { try { String token = RandomString.make(30); userService.updateResetPasswordToken(token, email); String […]

By qbi
Categorized as angular, java, spring, spring-boot, spring-security Tagged , , , ,

Save a PDF generated by SpringBoot in Angular

I am trying to save a PDF using Angular and Spring Boot. When I make an API call, my Java code is fetching the data from the database and transforming it to a byte-stream. This stream is sent as response. if(format.equals(Constant.PDF_FORMAT)) { ByteArrayInputStream stream = reportPDF.generateReportDocument(dtos); HttpHeaders headers = new HttpHeaders(); headers.add("Content-Disposition", "inline; filename=report.pdf"); return […]

By Lucifer Geralt
Categorized as angular, java, spring-boot Tagged , ,

How to access another column in a different table using @OneToOne?

@Table(name = "TABLE_A") @Data public class someClassOne { @Id @Column(name = "HEAD_ONE") private String head; @OneToOne(fetch = FetchType.EAGER) @JoinColumn(name="HEAD_ONE", referencedColumnName = "HEAD_TWO", insertable = false, updatable = false) private someClassTwo someVar; } —————————————– @Entity @Table(name = "TABLE_B") @Data public class someClassTwo { @Id @Column(name = "HEAD_TWO") private String tail; @Id @Column(name = "FIRST_NAME") private String […]

JHipster generated file failed to convert property value of type ‘java.lang.String’ to required type ‘java.time.LocalDate’

I have generated the files by using JHipster and currently I am trying to call a query which involves a Date variable but am getting a failed conversion. The following is my typescript file method which provide the criteria query for the search. loadSearchPage(page?: number): void { const pageToLoad: number = page ||; this.transactionService […]

By NiC
Categorized as angular, java, jhipster, typescript Tagged , , ,

Unable to upload file to s3 bucket from a different server

Am working on an application having Agular font end and java as backend. Inside this application we have a file upload. File type will be .txt. We are deployed Agular application in a server called datacenter part deployed in S3 server. If am upload file to one of my s3 bucket, its says file […]

By arj
Categorized as amazon-s3, amazon-web-services, angular, java Tagged , , ,

How to access json data which is present in payload of angular request in springBoot post API || syncfusion angular calender

Getting the below data in the payload tab of my browser while sending post requests. "–batch_8c82e185-cbdf-4d70-a62d-a48c9e869bf8 Content-Type: application/http; msgtype=request POST /api/null HTTP/1.1 Content-Type: application/json; charset=utf-8 Host: localhost:4200 {"Subject":"ankita","StartTime":"2021-11-29T04:00:00.000Z","EndTime":"2021-11-29T04:30:00.000Z","IsAllDay":false,"StartTimezone":null,"EndTimezone":null,"RecurrenceRule":null,"Id":4} –batch_8c82e185-cbdf-4d70-a62d-a48c9e869bf8–" Note: I am using a third-party library(syncfusion calendar) where I can’t customize my request in the body part with JSON. I am only concerned with the […]

swagger generated client method not working, spring boot angular

I have a controller which has an endpoint method to generate an excel file: @RestController @RequestMapping("api/v1/report") @AllArgsConstructor @CrossOrigin @Validated @Tag(name = "report-controller", description = "Controller managing operations related to reports") public class ReportController { private final ReportServiceImpl reportService; @PostMapping(value = "/report-file", produces = MediaType.MULTIPART_FORM_DATA_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) @Operation(summary = "Generate the report as Excel file […]

integrated jasper report, free maker in angular [closed]

I have design function export report with java and angular front end. Client design template about third-party software after that print template code in display, but now I want integrated everything in front end (people can be design jasper report and free maker in front end not dependent on third-party software). Can I do that […]

By HuyNQ
Categorized as angular, java Tagged ,
1 2 3 70

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