tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugen Kuleshov <a...@hco.kollegienet.dk>
Subject Re: request for comments about Multilinguage JSP
Date Thu, 17 Feb 2000 13:00:16 GMT
Assaf Arkin wrote:
 
> I totally agree. And also produce text from within Java code (Java 1.2
> supports that nicely).
> 
> But if you need database or progamattic messages, you still end up
> having one JSP page supporting multiple languages.

  Common. Data related things is a Controller's and Model's business in
Model-View-Controller appllication model. There are one controller for
multiple languages and it is produced data depends from request. Then
View part must visualise this data. I can use servlets, XML/XSLP
transformers, JSP for implementing View. There are not only one way. But
if I use JSP I actually can't implement usefull View part for multiple
languages. There are couple ways:

1. Controller Servlet -> forwarding request to JSP -> view.jsp
   there I must check request in Controller servlet and then change
view.jsp name to view.en.jsp, view.de.jsp, etc. It's JSP Model 2. Look
at jGuru's article at februar's www.javaworld.com

2. view.jsp extends controller servlet class
   there are no way to have multilanguage View. :(
    
> The point that was raised is whether multiple JSP pages, one for each
> language, makes sense. XSLT solves that. Java code (and JSP beans) solve
> the remaining issues.

  As I said, multiple JSP need's for designer (not for programmer who
implement data processing). Just look at this code (it's just
schematic):

<!-- index.en.jsp -->
... there are JSP beans initialisation
<html>
<body>
<center>
<h1>Hello!</h1>
<img src="promotion_banner_in_english.gif">
<%= jspBean.getVariable() %>
</center>
</body>
</html>

<!-- index.de.jsp -->
... there are JSP beans initialisation
<html>
<body>
<center>
<h1>Guten tag!</h1>
<img src="promotion_banner_in_german.gif">
<%= jspBean.getVariable() %>
</center>
</body>
</html>

  Eugen Kuleshov.

Mime
View raw message