Spring boot 2 - Template system recommendation needed for commerce site - spring-boot

We are planning to design a commerce site, using Spring boot as back end.
We would like our customers to be able to customize the front end template provided or create their own front templates.
Spring boot by default supports many templates, however, it seems there is no way to use them safely by the end customer, for example, they could call static methods if they know the class and method names.
It seems the correct way (without inventing a new safe template system) is to use front end template system. The idea is we provide a set of restful apis, and the template consumes the data and render the UI.
Are there any existing front end template systems / page builder we can use? Ideally, the template supports drag and drop editing of the template, as the customers are not developers.
Thanks!

Related

Safe template engine (allow user to edit) in spring MVC?

I am wondering if there is a way to disable method invocations in thymeleaf? We would like to give our users the ability to edit the templates in our application. We plan to use thymeleaf, but we do not want users to be able to call methods or access static fields or methods.
I found an old post Disabling static context and method invocation in Thymeleaf It was not possible in 2018, I am wondering if it is still the case in 2022?
If this cannot be disabled in thymeleaf, then are there any safe template engines available in spring?
Thanks

What is the best way to create a new blank UI while keeping the ABP Framework infrastructure?

In a Multitenancy B2C application, the interface created by the Application Startup Template applies well to the backoffice, but for the storefront website I think it would be necessary to create a blank UI project (angular or MVC).
What would be the best practice for keep the ABP infrastructure that provides functionality such as customization by Tenant, Tag Hellpers, Proxies, Localization, etc. without bringing unnecessary dependencies such as JS libraries and other components like menus, datatables, sidebars?
What you are looking for is a Public application template. Abp framework is created modularity in mind so that you can use modules in each other if they are developed in modular way.
I don't think it is feasable to say "add these projects and libraries".
However, you can check the microservice demo, PublicWebSite application at abp-samples to see which libraries are added so that you can modify an empty project as you desire.
Overriding a View Component The ABP Framework, pre-built themes and modules define some re-usable view components. These view components can be replaced just like a page described above.
https://docs.abp.io/en/abp/latest/UI/AspNetCore/Customization-User-Interface#overriding-a-view-component
Replacing ALL UI Theme Package with your custom Project by copy the Basic Theme (from Github).
MVC https://community.abp.io/articles/creating-a-new-ui-theme-by-copying-the-basic-theme-for-mvc-ui-yt9b18io
Blazor https://community.abp.io/articles/creating-a-new-ui-theme-by-copying-the-basic-theme-for-blazor-ui-qaf5ho1b
Or check these others links https://community.abp.io/articles/changing-ui-theme-for-abp-mvc-razor-pages-ui-ravx6a0o.

View technologies for a spring mvc web application

I'm developping a web application with Spring MVC, and I'm totally new in web design I want to write my Views, but i don't really know how to design all of that, I need about two views, One form for an advanced search for items, and the other for viewing results.
is there any framework or facilities that i can begin with ?
I've skimed view Technologies part in the spring documentation, I found:
JSP/JSTL
Tiles
Velocity & Freemaker
XSLT
Is that all i can use ? which one you recommand.
The mostly used view implementation (which also has best tool support) is JSP/JSTL.
From the Velocity/Freemarker family (sort of) you can look at ThymeLeaf - it's clean and really easy to learn. It also gives you ability to use natural templating - HTML files which, without changes, work in web application (as SpringMVC views) and when opened directly in browser.

Frontend ajax framework work with Grails

I have some knowledge about Flex and Java EE, they are good for web application development. Anyway when I try to write a typical web page that is based on HTML/CSS/Javascript, I think I should take a look at some new program language/framework.
I heard much good news about grails and finally decided to learn it instead of python, ruby, scale… But I still don’t have an overview of the whole structure. Grails is a backend framework like php, jsp, jsf right? So that probably means, it’s a replacement of Java EE in backend, then how about the frontend (need ajax functionality), what are people using with grails?
thanks
Grails is not a replacement, it is an abstraction around the tradition Java EE stack and some extremely popular libraries like Spring and Hibernate, that allows you to go faster by using "convention over configuration".
One component of Grails is GSPs, groovy server pages, which is a front end technology, the V in the MVC (Model View Controller) paradigm. You also have Domain Objects, which are the M (Model), and Controllers, which are the C. Grails also has Services which are best put into the M category (IMHO) of the MVC paradigm. So the Model arrangement in Grails gives you relatively easy persistence (using hibernate under the covers), the Services give you great reusability in your business and transactional logic, and the Controller simply invoke the right logic for a given request, and return the response.
One part of that response is what gets displayed on the screen. In a simple webapp, GSPs fill that role -- the controller tells the browser to render a specific GSP which has data bound to it from the service method that was invoked in the controller. However, it is easy to have the controller return json, so if the endpoint bound to the controller is an ajax request, the client can handle the response itself.
You can use any front end technology you want in a grails app. The default is GSPs, which is an extension of JSPs, which are part of the traditional java stack, but you can use jQuery, Sencha, Sproutcore, Backbone, anything you want. You would have one GSP in that case which bootstraps your javascript code, and the rest would be handled by the client application.
Grails is a web framework and is not just a backend framework. It supports both JSP and GSP ( Groovy Server Pages) for views.
If you plan to use Ajax functionality, you can make use of one of many javascript frameworks available. You can also go ahead with Flex (since you already know it) or use a javascript framework like ExtJs, Dojo, YUI etc...

What is sitemesh

I have seen Sitemesh used with Spring and Freemarker(FTL). So I want to know what is Sitemesh and its use with FTL, with example.
#see: http://www.opensymphony.com/sitemesh/
What Is It?
SiteMesh is a web-page layout and decoration framework and web- application integration framework to aid in creating large sites consisting of many pages for which a consistent look/feel, navigation and layout scheme is required.
SiteMesh intercepts requests to any static or dynamically generated HTML page requested through the web-server, parses the page, obtains properties and data from the content and generates an appropriate final page with modifications to the original. This is based upon the well-known GangOfFour Decorator design pattern.
SiteMesh can also include entire HTML pages as a Panel within another page. This is similar to a Server-Side Include, except that the HTML document will be modified to create a visual window (using the document's Meta-data as an aid) within a page. Using this feature, Portal type web sites can be built very quickly and effectively. This is based upon the well-known GangOfFour Composite design pattern.
SiteMesh is built using Java 2 with Servlet, JSP and XML technologies. This makes it ideal for use with J2EE applications, however it can be integrated with server-side web architectures that are not Java based such as CGI (Perl/Python/C/C++/etc), PHP, ColdFusion, etc...
SiteMesh is very extensible and is designed in a way in which it is easy to extend for custom needs.
sitemesh is a web page layout framework.
OpenSymphony doesn't seem to be around anymore, so the best documentation for Sitemesh I've seen is available through their Wiki and as the Readme on their Github repository.
I would caution that if you're interested in using Sitemesh, or at least understanding its structure in a project, Sitemesh2 and Sitemesh3 have significant differences in their structure and implementation, though they work conceptually the same way.

Resources