Rewrite filter problem
someone88 Mar 15, 2009 8:24 PMHello!
My web.xml
<listener> <listener-class>org.jboss.seam.servlet.SeamListener</listener-class> </listener> <filter> <filter-name>Seam Filter</filter-name> <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class> </filter> <filter-mapping> <filter-name>Seam Filter</filter-name> <url-pattern>/pages/*</url-pattern> </filter-mapping> <servlet> <servlet-name>Seam Resource Servlet</servlet-name> <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>Seam Resource Servlet</servlet-name> <url-pattern>/seam/resource/*</url-pattern> </servlet-mapping> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.jsp</param-value> </context-param>
components.xml
<?xml version="1.0" encoding="UTF-8"?> <components xmlns="http://jboss.com/products/seam/components" xmlns:core="http://jboss.com/products/seam/core" xmlns:persistence="http://jboss.com/products/seam/persistence" xmlns:spring="http://jboss.com/products/seam/spring" xmlns:async="http://jboss.com/products/seam/async" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:web="http://jboss.com/products/seam/web" xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd http://jboss.com/products/seam/spring http://jboss.com/products/seam/spring-2.1.xsd http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd http://jboss.com/products/seam/async http://jboss.com/products/seam/async-2.1.xsd"> <core:manager conversation-timeout="120000" concurrent-request-timeout="500" conversation-id-parameter="cid"/> <core:init debug="true"/> <web:rewrite-filter view-mapping="*.seam"/> <web:exception-filter url-pattern="*.seam"/> <web:redirect-filter disabled="true"/> </components>
pages.xml
<?xml version="1.0" encoding="UTF-8"?> <pages xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd"> <page view-id="/pages/userRegister.jsp"> <rewrite pattern="/register"/> </page> </pages>
jsp page code
<h:form id="Register"> <h:outputLink value="/myproject/pages/userRegister.seam" ><h:outputText value="register"/></h:outputLink> </h:form>
When click at this link, i redirect to userRegister page, but in address bar /myproject/pages/userRegister.seam. And in log file write
DEBUG [org.jboss.seam.web.RewritingResponse] - encodeURL /myproject/pages/userRegister.jsf -> /myproject/register
what i do wrong?? How i can enable rewrite filter??
Sorry for my english :)
Thanks.