[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4228) expose rewrite rules
by Duncan Stockdill (JIRA)
expose rewrite rules
--------------------
Key: JBSEAM-4228
URL: https://jira.jboss.org/jira/browse/JBSEAM-4228
Project: Seam
Issue Type: Feature Request
Components: Core
Affects Versions: 2.1.2.CR2
Reporter: Duncan Stockdill
The RewriteFilter translates the requests to the internal view URLs and dispatches the request with the rewritten URL. e.g.
RequestDispatcher dispatcher = request.getRequestDispatcher(newPath);
dispatcher.forward(request, response);
As a result, the original URL is lost to processing further down the chain. In some cases it's useful to have access the original URL.
Potentially the URL could be stored and made available as an injectable component, but a more generic answer would be to expose the rewrite rules so an internal view can be converted to an external URL programatically. e.g. add matchPatterns or rewritePath to Pages class.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4209) StringIndexOutOfBoundsException in RedirectHandler
by Nicko Cadell (JIRA)
StringIndexOutOfBoundsException in RedirectHandler
--------------------------------------------------
Key: JBSEAM-4209
URL: https://jira.jboss.org/jira/browse/JBSEAM-4209
Project: Seam
Issue Type: Bug
Affects Versions: 2.1.2.CR2
Reporter: Nicko Cadell
StringIndexOutOfBoundsException in RedirectHandler
This exception is thrown if ViewExpiredException is thown and I'm hndling this with a redirect back to the same page: i.e. my exception config looks like:
{code}
<exception class="javax.faces.application.ViewExpiredException">
<redirect />
</exception>
{code}
AND I am using the <web:rewrite-filter /> to rewrite the URLs.
The code in RedirectHandler assumes that the request servlet path will contain a URL that matches up to one of the view by changing the file extension. This is not always the case. In this case the RewriteFilter is intercepting the path, which does not contain a .seam extension.
The following exception is thrown:
{code}
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1938)
at org.jboss.seam.exception.RedirectHandler.handle(RedirectHandler.java:39)
at org.jboss.seam.exception.Exceptions.handle(Exceptions.java:76)
at org.jboss.seam.web.ExceptionFilter.endWebRequestAfterException(ExceptionFilter.java:114)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:70)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
{code}
It looks like the RewriteFilter process() method does have some commented out code to wrap the request so that the call to getServletPath() would return the rewritten URL (i.e. something that could be converted to a view id by the RedirectHandler). I assume that the wrapped request was commented out to resolve some other issue.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 4 months