I want to create server with nestjs and front-end view with JSP. Can I deploy server-server and front-end-server each and connect front-end and server using Restful API? Or Can JSP be only used with Spring?
Related
I have to create 2 projects. Web Service and one is Web project.
I created the web service using Rest in spring boot and web project using dynamic web project using Jsp and servlets.
Now I have to consume the web service in web project. How can I do ?
You can do AJAX call from your JSP side to your REST server side using Javascript. You can also use library like JQuery or axios (there MDN versions since you are using JSP) to send REST API calls to your same or any other server. You can follow https://stackoverflow.com/a/44859872/8684299 this answer.
I want to learn the Spring Framework and therefore I decided to make a web application using it, but I don't want to use Spring MVC as it still uses JSP. What all projects from Spring can be used if I want to have a UI which can be made using React / Angular and the backend is managed by Spring.
You have to use REST API, and pass data to front-end JS framework via JSON.
Look here: https://spring.io/guides/gs/rest-service/
Start with creating a simple Rest Controller with Spring Boot.
Then you have to choose your JavaScript framework (jQuery, Angular, React),
and make a HTTP request to URL typed in your #RestController.
You can achieve this by using AJAX method from your JS framework.
Try this,it will speed up your development
Restful Web Service with Spring Boot
by the way,if you want to use Angular/React+Spring Boot you can use JHipster, this tool will just do the basic setup for your Angular/React+Spring Boot application in couple of minutes,the website has a clear video tutorial you can use it will only take about 15 min approx
Jhipster
How to call the backend API from front end which is thymleaf based when both the frontend and backend API are 2 different microservices.
And also I have a Eureka Server and microservices that are registered to this server. I have the frontend and backend APIs ready.
Can anyone help in how can I make the API call to the other microservice from the Thymeleaf templates html.
Following is the Architecture for my microservice:-
Application Architecture
Using Thymeleaf as frontend template.
Created the following modules:-
web-ui module : Thymeleaf
service-registry : Eureka Server
search-service & product-service : Spring Boot and
EurekaDiscoveryClient
Need help in communication of web-ui with service-registry but not sure how to implement the api-gateway.
I am creating a web application that will basically register users onto a website where they can log-in and browse an inventory of items, much like a store. The user info and store items will be stored in a MongoDB.
For the server/back-end side, I plan on using Spring RESTful services implementation to communicate with the MongoDB and perform the CRUD operations when necessary.
Now my main question is what to use for the client-side (Browser rendering, web pages, etc). I am considering either JSF, along with Facelets for the view, or Spring MVC and Facelets for the view.
If I use JSF for my client-side, will this architecture work?
Spring and JSF working well together.
http://docs.spring.io/autorepo/docs/spring/3.2.x/spring-framework-reference/html/web-integration.html
http://docs.spring.io/spring-webflow/docs/current-SNAPSHOT/reference/html/spring-faces.html
You can choose any framework for the frontend application and call your backend with REST Calls.
I'm making a Spring RESTFUL service and i wonder. Can I make a Spring RESTFUL service combine with a web app in a project. If it is possible, how to configure it?
.
yes that is possible to combine with web-app
for example your controller package into your restful controller also work
that is possible to crud operation via restful web service.