Ad

Different Layouts And I18n In JSP Application

- 1 answer

I have a bunch of JSP files and backend in Tomcat. I have 3 different versions of JSP with same logic inside but with different layouts. So if I change some logic I have three JSP file to fix.

What is the proper soution for such a scenario? I thought of some XML and XSLT stack: backend gives only data in XML and than for each layout I have XSLT that does some magic.

Just imagine that you need to provide stackoverflow in various languages in JSP. Logic the same but layout different.

Could you point me into some direction?

Ad

Answer

Learn about MVC (Model View Controller) and the idea that JSP should be the View part of it and should not contain any logic whatsoever. Logic belongs in a Model class.

Ad
source: stackoverflow.com
Ad