Demonstrating Bloggest

In order to run the Bloggest web application, it requires that the Elasticsearch data store be up and running. The following command can be used to start Elasticsearch:

$ <Path to Elasticsearch>/bin/elasticsearch

When everything is put together, build and run the Bloggest, which you will be able to access using the http://<host>:<port> URL.

There are several ways to run a Spring Boot application, some of them are mentioned here:

  • Running the Spring Boot application main class using an IDE.
  • Building a JAR or WAR file using the following Maven command and then running:
$ mvn clean install
$ java -jar target/<package-name>.[jar|war]
  • Running using a Spring Boot Maven plugin:
$ mvn clean spring-boot:run

After running, the Bloggest web application will show the List Articles page as follows:

In this page, the header, footer, and right panel with Search bar are coming from the common/standardPage.ftl common layout. The dynamic content is only available in the middle. Since in this case the admin user is already logged in, in the top right the system welcomes the user with the username. If no user is logged in, that section will show the Login link (username user, password password for USER role, username admin, password password for ADMIN role).

When the title link is clicked, the following Show Article page is shown:

Things to note on this page are that the page is showing the body section of the article in the styled text with even images. Also, the URL is using a permanent link to call the /article/show/ endpoint with. This is important as this URL is now search engine optimization (SEO) friendly, meaning it can be indexed easily in search engines such as Google, Bing, and so on to get more leads.

The following page is for the Add Article use case:

The page has text boxes for Title, Perma Link (this will be derived dynamically from the title), Summary, and Body. You can see the CKEDITOR in action for the body section.

The Edit Article use case will look like the following:

By clicking on the Edit button under the article on the List Articles page, this page can be reached. The Edit button will be visible only if the logged-in user has the administrator role or is the original author of that particular article. 

The following page shows a Search Article use case where the keyword Java is searched:

Matching results will be displayed on the List Articles page. And finally, the result of the Delete Article use case is displayed on the following page:

An article can be deleted using the Delete button on the List Articles page. The Delete button will be visible only if the logged-in user has the administrator role or is the original author of that particular article. Eventually, it will redirect to the List Articles page.

Since the Bloggest application may be viewed using devices other than a computer, it supports a responsive UI with Bootstrap. All pages are responsive to different screen sizes and resolutions. The following is the Show Article page with smaller dimensions:

The following is the page for the Login use case:

This page comes out of the box with Spring Security 5 and it is responsive and more stylish than its predecessor, which was used in Chapter 2Building a Basic Web Application

The following is the page for the Log out use case:

Logout can be performed by clicking the Log Out link in the header. Unlike the predecessor version of Spring Security, Spring Security 5 asks for confirmation during logout out of the box. When logout is confirmed it will redirect to the Login page with a message, as follows:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.64.132