tailieunhanh - Designing Enterprise Applicationswith the J2EETM Platform 2nd phần 9

và khởi động lại quá trình thẩm định, điều này không phải lúc nào cũng chấp nhận được. Các ứng dụng sẽ cung cấp cho người sử dụng một cơ hội để vô hiệu phiên xác thực và reauthenticate như một bản sắc một cách thích hợp đặc quyền hơn. Các yếu tố trang lỗi có thể được sử dụng trong mô tả triển khai của một ứng dụng Web | WEB TIER INTERNATIONALIZATION 331 localized selectively with this scheme. The logic for determining which file to forward to is in a dispatching servlet or servlet filter which can implement the same naming convention scheme as do resource bundles. The forwarding component can always choose the most specific file available and use a default file with no localization suffix as a fallback. The page-per-locale approach has the following benefits Greater customizability Using resource bundles to customize a single JSP page results in pages whose structure is essentially the same for all locales. Using one JSP page per locale provides maximum customizability of the content for a locale because customizations are not limited to the contents of a resource bundle. As a result the page-per-locale approach is prefereable when content differs substantially between locales. Source clarity All of the content for a locale appears in a single file the JSP file for the locale instead of being separated between a JSP page file with some structural tags and a properties file or resource bundle class containing named strings. At the same time this approach has some drawbacks. Maintaining a consistent look-and-feel between locales is more difficult with separate JSP pages than with resource bundles. Separate files must be created and maintained consistently for several locales. This means more maintenance than does the resource bundle approach. The Web-tier framework and tools you select for creating your application may influence your decision in how to support internationalized content. The sample application uses a templating mechanism providing both structural consistency between locales and the flexibility of page-per-locale localization. The templating mechanism uses an XML screen definitions file for each locale to assemble localized JSP pages into a single page. The screen definitions file for a locale specifies a template file and maps localized JSP pages to symbolic names .

TỪ KHÓA LIÊN QUAN