Re: [solved] Problem with prettyfaces + a4j:commandLink

Splash Forums PrettyFaces Users [solved] Problem with prettyfaces + a4j:commandLink Re: [solved] Problem with prettyfaces + a4j:commandLink

#19875

smitha.h.rao
Participant

<filter>

<filter-name>Pretty Filter</filter-name>

<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>Pretty Filter</filter-name>

<url-pattern>/*</url-pattern>

<dispatcher>REQUEST</dispatcher>

<dispatcher>FORWARD</dispatcher>

<dispatcher>ERROR</dispatcher>

</filter-mapping>

My web.xml has all the dispatcher tags.

full web.xml is pasted below:

<?xml version=”1.0″ encoding=”UTF-8″?>

<web-app xmlns=”http://java.sun.com/xml/ns/j2ee”

xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” version=”2.5″

xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd“>

<!– Display name for this application –>

<display-name>skill</display-name>

<context-param>

<param-name>org.richfaces.SKIN</param-name>

<param-value>plain</param-value>

</context-param>

<context-param>

<param-name>contextConfigLocation</param-name>

<param-value>

/WEB-INF/applicationContext.xml /WEB-INF/controller-servlet.xml

</param-value>

</context-param>

<context-param>

<param-name>javax.faces.STATE_SAVING_METHOD</param-name>

<param-value>client</param-value>

<description>

State saving method: “client” or “server” (= default) See

JSF Specification 2.5.2

</description>

</context-param>

<context-param>

<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>

<param-value>true</param-value>

<description>

This parameter tells MyFaces if javascript code should be

allowed in the rendered HTML output. If javascript is

allowed, command_link anchors will have javascript code that

submits the corresponding form. If javascript is not

allowed, the state saving info and nested parameters will be

added as url parameters. Default: “true”

</description>

</context-param>

<context-param>

<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>

<param-value>false</param-value>

<description>

This parameter tells MyFaces if javascript code should be

allowed in the rendered HTML output. If javascript is

allowed, command_link anchors will have javascript code that

submits the corresponding form. If javascript is not

allowed, the state saving info and nested parameters will be

added as url parameters. Default: “false”

Setting this param to true should be combined with

STATE_SAVING_METHOD “server” for best results.

This is an EXPERIMENTAL feature. You also have to enable the

detector filter/filter mapping below to get JavaScript

detection working.

</description>

</context-param>

<context-param>

<param-name>org.apache.myfaces.PRETTY_HTML</param-name>

<param-value>true</param-value>

<description>

If true, rendered HTML code will be formatted, so that it is

“human readable”. i.e. additional line separators and

whitespace will be written, that do not influence the HTML

code. Default: “true”

</description>

</context-param>

<context-param>

<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>

<param-value>false</param-value>

<description>

If true, a javascript function will be rendered that is able

to restore the former vertical scroll on every request.

Convenient feature if you have pages with long lists and you

do not want the browser page to always jump to the top if

you trigger a link or button action that stays on the same

page. Default: “false”

</description>

</context-param>

<context-param>

<param-name>javax.faces.CONFIG_FILES</param-name>

<param-value>

/WEB-INF/faces-config.xml,/WEB-INF/faces-managed-beans.xml,/WEB-INF/faces-navigation.xml

</param-value>

</context-param>

<filter>

<filter-name>Pretty Filter</filter-name>

<filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>Pretty Filter</filter-name>

<url-pattern>/*</url-pattern>

<dispatcher>REQUEST</dispatcher>

<dispatcher>FORWARD</dispatcher>

<dispatcher>ERROR</dispatcher>

</filter-mapping>

<!– Richfaces configuration –>

<filter>

<filter-name>richfaces</filter-name>

<display-name>RichFaces Filter</display-name>

<filter-class>org.ajax4jsf.Filter</filter-class>

</filter>

<!– Richfaces configuration –>

<!– myfaces configuration starts here –>

<filter>

<filter-name>MyFacesExtensionsFilter</filter-name>

<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>

<init-param>

<param-name>maxFileSize</param-name>

<param-value>20m</param-value>

<description>Set the size limit for uploaded files.

Format: 10 – 10 bytes

10k – 10 KB

10m – 10 MB

1g – 1 GB

</description>

</init-param>

</filter>

<filter>

<filter-name>GeekFilter</filter-name>

<display-name>Geek Login Filter</display-name>

<filter-class>com.skill.view.bean.common.GeekFilter</filter-class>

</filter>

<filter>

<filter-name>ForumFilter</filter-name>

<display-name>Forum Filter</display-name>

<filter-class>com.skill.view.bean.common.ForumFilter</filter-class>

</filter>

<!– extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages –>

<filter-mapping>

<filter-name>MyFacesExtensionsFilter</filter-name>

<!– servlet-name must match the name of your javax.faces.webapp.FacesServlet entry –>

<servlet-name>Faces Servlet</servlet-name>

</filter-mapping>

<!– extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) –>

<filter-mapping>

<filter-name>MyFacesExtensionsFilter</filter-name>

<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>

</filter-mapping>

<filter-mapping>

<filter-name>MyFacesExtensionsFilter</filter-name>

<url-pattern>*.faces</url-pattern>

</filter-mapping>

<filter-mapping>

<filter-name>MyFacesExtensionsFilter</filter-name>

<url-pattern>*.jsf</url-pattern>

</filter-mapping>

<!– myfaces configuration ends here –>

<filter-mapping>

<filter-name>GeekFilter</filter-name>

<url-pattern>/login/*</url-pattern>

</filter-mapping>

<filter-mapping>

<filter-name>GeekFilter</filter-name>

<url-pattern>/register/*</url-pattern>

</filter-mapping>

<filter-mapping>

<filter-name>GeekFilter</filter-name>

<url-pattern>/admin/*</url-pattern>

</filter-mapping>

<filter-mapping>

<filter-name>GeekFilter</filter-name>

<url-pattern>/organization/*</url-pattern>

</filter-mapping>

<filter-mapping>

<filter-name>GeekFilter</filter-name>

<url-pattern>/question/*</url-pattern>

</filter-mapping>

<!–

<filter-mapping>

<filter-name>ForumFilter</filter-name>

<url-pattern>/forum/*</url-pattern>

</filter-mapping>

–>

<filter-mapping>

<filter-name>richfaces</filter-name>

<servlet-name>Faces Servlet</servlet-name>

</filter-mapping>

<!– For Forum integration –>

<filter>

<filter-name>clickstream-jforum</filter-name>

<filter-class>net.jforum.util.legacy.clickstream.ClickstreamFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>clickstream-jforum</filter-name>

<url-pattern>*.page</url-pattern>

</filter-mapping>

<!– ******* –>

<!–

<listener>

<listener-class>

org.springframework.web.context.request.RequestContextListener

</listener-class>

</listener>

–>

<listener>

<listener-class>com.skill.view.util.SkillSessionListener</listener-class>

</listener>

<listener>

<listener-class>com.skill.view.util.SkillFileLoaderCache</listener-class>

</listener>

<listener>

<listener-class>

org.springframework.web.context.ContextLoaderListener

</listener-class>

</listener>

<!– For Forum integration –>

<listener>

<listener-class>net.jforum.ForumSessionListener</listener-class>

</listener>

<!– ******* –>

<!– Richfaces configuration –>

<!–

<servlet>

<servlet-name>SpringContextServlet</servlet-name>

<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

–>

<servlet>

<servlet-name>Faces Servlet</servlet-name>

<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet>

<servlet-name>action</servlet-name>

<servlet-class>

org.apache.struts.action.ActionServlet

</servlet-class>

<init-param>

<param-name>config</param-name>

<param-value>/WEB-INF/struts-config.xml</param-value>

</init-param>

<init-param>

<param-name>debug</param-name>

<param-value>3</param-value>

</init-param>

<init-param>

<param-name>detail</param-name>

<param-value>3</param-value>

</init-param>

<load-on-startup>0</load-on-startup>

</servlet>

<servlet>

<servlet-name>TilesServet</servlet-name>

<servlet-class>

org.apache.struts.tiles.TilesServlet

</servlet-class>

<init-param>

<param-name>definitions-config</param-name>

<param-value>/WEB-INF/tiles-defs.xml</param-value>

</init-param>

<init-param>

<param-name>definitions-parser-validate</param-name>

<param-value>true</param-value>

</init-param>

<load-on-startup>2</load-on-startup>

</servlet>

<!– For apache chart component –>

<servlet>

<servlet-name>Chartlet</servlet-name>

<servlet-class>net.sf.jsfcomp.chartcreator.Chartlet</servlet-class>

</servlet>

<servlet>

<servlet-name>controller</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

<!– Jforum integration –>

<!– JForum Controller –>

<servlet>

<servlet-name>jforum</servlet-name>

<servlet-class>net.jforum.JForum</servlet-class>

<init-param>

<param-name>development</param-name>

<param-value>true</param-value>

</init-param>

</servlet>

<!– Installer –>

<servlet>

<servlet-name>install</servlet-name>

<servlet-class>net.jforum.InstallServlet</servlet-class>

<init-param>

<param-name>development</param-name>

<param-value>true</param-value>

</init-param>

</servlet>

<!– Servlet for logout –>

<servlet>

<servlet-name>ForumLogoutFilter</servlet-name>

<servlet-class>com.skill.forum.ForumLogoutFilter</servlet-class>

</servlet>

<servlet>

<description>Servlets helps adding tag data to a Test or Guru</description>

<display-name>Tag Servlet</display-name>

<servlet-name>TagServlet</servlet-name>

<servlet-class>com.skill.view.bean.guru.test.TagServlet</servlet-class>

</servlet>

<servlet>

<description>This is the description of my J2EE component</description>

<display-name>This is the display name of my J2EE component</display-name>

<servlet-name>GuruTagServlet</servlet-name>

<servlet-class>com.skill.view.bean.guru.GuruTagServlet</servlet-class>

</servlet>

<!– ************ –>

<servlet-mapping>

<servlet-name>controller</servlet-name>

<url-pattern>/servlet/*</url-pattern>

</servlet-mapping>

<!– Faces Servlet Mapping –>

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

<url-pattern>*.jsf</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>Faces Servlet</servlet-name>

<url-pattern>*.faces</url-pattern>

</servlet-mapping>

<!– For apache chart component –>

<servlet-mapping>

<servlet-name>Chartlet</servlet-name>

<url-pattern>*.chart</url-pattern>

</servlet-mapping>

<!– Jforum Integration –>

<!– Mapping –>

<servlet-mapping>

<servlet-name>install</servlet-name>

<url-pattern>/install/install.page</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>jforum</servlet-name>

<url-pattern>*.page</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>ForumLogoutFilter</servlet-name>

<url-pattern>/servlet/ForumLogoutFilter</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>TagServlet</servlet-name>

<url-pattern>/servlet/TagServlet</url-pattern>

</servlet-mapping>

<servlet-mapping>

<servlet-name>GuruTagServlet</servlet-name>

<url-pattern>/servlet/GuruTagServlet</url-pattern>

</servlet-mapping>

<!– *********** –>

<session-config>

<session-timeout>35<!– minutes –></session-timeout>

</session-config>

<error-page>

<error-code>500</error-code>

<location>/login/sessionExpired.faces</location>

</error-page>

<!– <error-page>

<error-code>404</error-code>

<location>/login/sessionExpired.faces</location>

</error-page>–>

<error-page>

<exception-type>javax.servlet.ServletException</exception-type>

<location>/login/sessionExpired.faces</location>

</error-page>

<error-page>

<exception-type>java.lang.NullPointerException</exception-type>

<location>/login/sessionExpired.faces</location>

</error-page>

<error-page>

<exception-type>java.lang.RuntimeException</exception-type>

<location>/login/sessionExpired.faces</location>

</error-page>

<taglib>

<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>

<taglib-location>/WEB-INF/struts-html.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>

<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/jsf_core.tld</taglib-uri>

<taglib-location>/WEB-INF/jsf_core.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/html_basic.tld</taglib-uri>

<taglib-location>/WEB-INF/html_basic.tld</taglib-location>

</taglib>

</web-app>