Troubleshooting

Here are a few issues we can come across while using a Play view:

  • The form is not submitted when you click on Submit and no errors are displayed using globalErrors.

    There may be a situation where a particular required field is missing or there is a typo in the name of the field. It will not be shown in globalErrors but if you attempt to display the error for an individual field, error.required will show up for the missing field.

  • Do we need to use Twirl templates for the application's views?

    No, Play does not force developers to use Twirl templates for the views. They are free to design the views in whichever way they find easy or comfortable. For example, this can be done by using Handlebars, Google Closure templates, and so on.

  • Does this affect the performance of the application in any way?

    No, unless there are no performance flaws in your view definitions, plugging it in a Play application will not affect the performance. There are projects that use the Play server for their native Android and iOS apps.

  • Are there any other templating libraries supported by Play?

    No, but there some Play plugins which aid in using other templating mechanisms or libraries that are available. Since they are developed by individuals or other organizations, check the licensing before using them.

  • Although application language configurations have been updated and messages added in various languages, the views are only rendered in English. There are no errors thrown at runtime and yet it doesn't work as expected.

    For Play to determine the language used from a request, it is required that the request should be an implicit one. Ensure that all the defined actions within the application make use of implicit requests.

    Another possibility can be that the Accept-Language header could be missing. This will be added by updating the browser settings.

  • Will a compilation error occur when a message that doesn't have a mapping in the language resources is accessed?

    No, a compilation error occurs if an undefined message is being accessed. You can implement this mechanism if required or use something from the open source plugins if they're available and meet your requirements.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.34.146