hirondelle.fish.main.visit
Class CustomController
Object
GenericServlet
HttpServlet
Controller
hirondelle.fish.main.visit.CustomController
- All Implemented Interfaces:
- Serializable, Servlet, ServletConfig
public final class CustomController
- extends Controller
Example implementation of translation by using multiple JSPs.
The one-JSP-per-language style is implemented by providing an override for
Controller.swapResponsePage(ResponsePage , Locale)
, as done here.
This style of implementing translation is not recommended,
since it causes so much repetition of identical markup across many JSPs.
The services of the hirondelle.web4j.ui.translate package should
be used instead.
Here, only one particular feature is affected - the Visits page, which is
split into Visit_en.jsp and Visit_fr.jsp, when this
custom Controller is used.
(The Visit.jsp page uses the recommended style of translation,
where markup is not repeated across multiple pages.)
This example is not complete - it merely exercises the general mechanism. To run it,
edit the servlet-class setting in web.xml to refer to this
custom Controller class. After starting the app, then navigate to the Visits page,
and flip the Locale using the Preferences page. This will exercise the mechanism.
- See Also:
- Serialized Form
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CustomController
public CustomController()
swapResponsePage
protected ResponsePage swapResponsePage(ResponsePage aResponsePage,
Locale aLocale)
- Returns a non-null value only if aResponsePage ends with 'Visit.jsp'.
- Overrides:
swapResponsePage
in class Controller
Copyright Hirondelle Systems - Generated 2013Oct19.12.26