JSF : status of a JavaServer Faces application in the software lifecycle.

Note the use of the context parameter PROJECT_STAGE. This parameter identifies the status of a JavaServer Faces application in the software lifecycle.

The stage of an application can affect the behavior of the application. For example, if the project stage is defined as Development, debugging information is automatically generated for the user. If not defined by the user, the default project stage is Production.

is an example web.xml file, showing this change in bold.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>faces/greeting.xhtml</welcome-file>
    </welcome-file-list>
</web-app>

ErrorPage Web.xml protect your stack trace

Java APP & Web contaner :
IMHO you should use settings for protect your web content from outside. I mean you have to hide service information of your web-site like : error page 400,403,404,500,503…

Settings per virtual domain :
You should use web.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
 <display-name>Training</display-name>
 <welcome-file-list>
  <welcome-file>index.jsp</welcome-file>
 </welcome-file-list>
 <!--- !!!!!!!!!! -->
 <error-page>
  <error-code>404</error-code>
  <location>/error/404.jsp</location>
 </error-page>
 <error-page>
  <exception-type>java.lang.Throwable</exception-type>
  <location>/error/exception.jsp</location>
 </error-page>
</web-app>

In this situation when resource will not be found (error 404) you server will show /error/404.jsp page where you could place (i.e.) like these :

1
Oops! Problems!

And all service information you could write to log or/and send to yourself by email (use JavaMail API i.e.)

JSTL TAGS

Refer to these hyperlinks

JSTL Examples http://www.cs.wcupa.edu/rkline/Java/jstl-examples.html
http://www.cs.wcupa.edu/docs/tld

1
2
3
4
c:   <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core">
fn:  <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" >
fmt: <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" >
xml: <%@taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" >

Also you should add these jars :

1
jstl.jar  standard.jar

MAVEN DEPENDENCIES add to WEB-INF/lib – HOWTO

How to automate adding the MAVEN DEPENDENCIES to WEB-INF/lib ?

You should add these lines into file ${PROJECT_HOME}/.settings/org.eclipse.wst.common.component

1
2
3
4
5
6
7
8
9
&nbsp;

deploy-path="/WEB-INF/lib"

handle="module:/classpath/con/org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"&gt;

consumes

&nbsp;

Continue reading