We suppose that we have a simple table that contains the products from figure below:
Further, we expose the data from this table via Spring Data REST. So, a request of type: http://localhost:8080/SHPaginating/items/?size=5 will produce a JSON response as below:
Now, we want to use PrimeNG DataTable Lazy to display data using pagination and sorted by item name as below:
And some HATEOAS information that you can use for further implementations:
The complete example is available here. First, you need to run npm install in \SHPaginating\src\main\webapp. The app is a WAR that can be tested under e.g. Payara.
Se afișează postările cu eticheta PrimeNG. Afișați toate postările
Se afișează postările cu eticheta PrimeNG. Afișați toate postările
duminică, 31 iulie 2016
luni, 11 iulie 2016
Data table pagination via PrimeNG + Spring MVC 4 RESTful web service + Hibernate JPA
Application output:
Simple database to provide data (database name: myproducts, table: products):
The complete example is available here.
miercuri, 29 iunie 2016
Using PrimeNG to authenticate via JWT to a container-less RestExpress microservice
We have two container-less microservices defined in RestExpress. The
endpoints are:
AuthenticationService - this service
respond to:
http://localhost:8587/clients.json
- create a new client
http://localhost:8587/jwts.json?apiKey={apikey}&secret={password}
- create a new JWT
http://localhost:8587/jwts/{jwt}
- verify if a JWT is valid
SecretService - this service needs
authentication and it respond to:
http://localhost:8086/secret/{secretid}
- send a secret ID to the secret service
In order to run the app:
1. Download, install MongoDB - this is needed for storing the users
2. Start MongoDB and the AuthenticationService
as in the README.txt file
3. Start SecretService as in the README.txt
file
4. Run npm
install and npm start
from the /PrimeNGandRestExpress/primengapp folder
Some screenshots:
Trying to access the SecretService without authentication:
Creating a new JWT:
Sending data to the SecretService after authentication:
The complete example is available here.
duminică, 28 februarie 2016
PrimeNG + MVC 1.0 (Ozark RI)
This post is a quick intro for a PrimeNG + MVC 1.0 (Ozark RI) application sample. Bascially we want to obtain the below result:
Abonați-vă la:
Postări (Atom)









