Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between Development and Production in MyFaces

Tags:

jsf

jsf-2

myfaces

I'm doing some development work in JSF with MyFaces and I got this warning.

*******************************************************************
*** WARNING: Apache MyFaces-2 is running in DEVELOPMENT mode.   ***
***                                         ^^^^^^^^^^^         ***
*** Do NOT deploy to your live server(s) without changing this. ***
*** See Application#getProjectStage() for more information.     ***
*******************************************************************

What is the difference between development and production mode? Are there security risks? Is it just performance enhancements?

like image 930
Mark Robinson Avatar asked Dec 19 '12 20:12

Mark Robinson


People also ask

What's the difference between development and production?

What's the difference between Development and Production? It is a bit confusing, because you can collect survey responses both when the project is in development (pre-production) and once it is in production. The main difference is that in production you cannot easily change fields in the survey, you will need to request help from an administrator.

What is the difference between 'prod' and 'Dev'?

On the other hand, "Dev" means "Development", its the environment which the developers work on. "Prod" means "Production". It describes the environment you are providing to the customers. On the other hand, "Dev" means "Development", its the environment which the developers work on.

What is the difference between formulation and product development?

I think one of the glaring differences between formulation and product development is the type of work you do. While as a formulator you may have a chance to express yourself creatively (depending on your projects), often times the bulk of your work is largely left-brain.

Is it possible to have different configurations for production and development environments?

You can have different configurations for production and development environments. Node.js assumes it's always running in a development environment. You can signal Node.js that you are running in production by setting the NODE_ENV=production environment variable.


1 Answers

There are no security risks, there are however performance implications. When project stage is set to development, then there will more often be logged and less be cached.

With regard to logging, additional debug information about how components are built and rendered will be logged. For example, if you have a <h:inputText> without any parent <h:form>, then this will be logged and displayed as a faces message. All queued faces messages which are not displayed in any of <h:message(s)> components will be displayed anyway in a separate message list at the bottom of the page, with an orange warning font, indicating "undisplayed" messages. Also, the exception handling is different, MyFaces will instead of the <error-page> show a rich error page including detail about the component tree and scoped variables.

With regard to caching, the Facelet cache will refresh more regularly. So if you make changes in a Facelet file and press F5, then the changes will "immediately" be reflected. This is not true for production stage, you'd basically need to restart the whole server.

Also the jsf.js JavaScript file will show up as the unminified version, allowing easier JS debugging in the webbrowser. In production stage, it's instead the minified version, which is thus smaller and faster to serve, but it is completely unreadable.

Mojarra has much similar behaviour, expect of the rich error page.

like image 70
BalusC Avatar answered Sep 28 '22 11:09

BalusC