Java templates for multiple WAR files

I have a web application with several WARs that was poorly developed. There is one WAR that is responsible for handling some kind of database authorization and defines a standard web page using jsp taglib. The main WAR basically checks user rights and, depending on this, displays links to the context path of other deployed WARS. Each of the other deployed WARs includes this custom lib tag.

I am working on redesigning this application, and one of the nice things I want to keep is that we have other project teams that developed these WAR modules that “connected” to our current system to take advantage of other things that we can offer.

I'm not quite sure how to handle page templates. I need a template system that could be easily used in several wars (I was thinking about jsp fragments?). I really only need to define a sequential section of the header and the main navigation. Everything that is still displayed on the page depends on the specific web project.

Any suggestions?

I hope this is clear if I cannot clarify more.

+3
source share
1 answer

Did something similar in the past using Sitemesh

we have defined a new web application called skins-app, which has only a common header, footer, navigator, which all others need. Sitemesh is configured through a file called WEB-INF / decorators.xml in the skin application

webapp WEB-INF/decorators.xml.

, "" .

<decorator name="main" page="/decorators/layout.jsp" webapp="skins-app">  
<pattern>/*</pattern> 
</decorator>

include/exclude, webapp, - "". Sitemesh.

+3

Source: https://habr.com/ru/post/1746620/


All Articles