[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, 10 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1841) Need examples/documentation for how to use seamgen generated EntityHome interefaces and related functionality
by steve tynor (JIRA)
Need examples/documentation for how to use seamgen generated EntityHome interefaces and related functionality
-------------------------------------------------------------------------------------------------------------
Key: JBSEAM-1841
URL: http://jira.jboss.com/jira/browse/JBSEAM-1841
Project: JBoss Seam
Issue Type: Feature Request
Components: Documentation
Affects Versions: 2.0.0.BETA1
Reporter: steve tynor
Please add some documentation, perhaps an example project, that uses seamgen-generated EntityHome classes in order to demonstrate the intended use of the wire(), isWired(), createInstance(), getDefinedInstance(), setId(), etc. functions. Some discussion on how these related to <param> and <f:param> in XHTML is also needed.
As it stands, these are completely undocumented without any explanation of their intended use, so those of us that have boostrapped a project with seamgen, have no guidance on how to maintian these classes as our application changes (new properties added to entities, etc.)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 10 months
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-2938) org.jboss.seam.util.XML doesn't validate
by Christian Bauer (JIRA)
org.jboss.seam.util.XML doesn't validate
----------------------------------------
Key: JBSEAM-2938
URL: http://jira.jboss.com/jira/browse/JBSEAM-2938
Project: Seam
Issue Type: Bug
Components: Core
Reporter: Christian Bauer
Assigned To: Norman Richards
Priority: Minor
The getRootElement() method is probably supposed to validate the XML file. However, it only sets a DTD EntityResolver:
SAXReader saxReader = new SAXReader();
saxReader.setEntityResolver(new DTDEntityResolver());
saxReader.setMergeAdjacentText(true);
return saxReader.read(stream).getRootElement();
This might trigger some magic flag that says "validate against this DTD", but the dom4j documentation says otherwise: http://www.dom4j.org/faq.html#how-validate
I've implemented my own routine which validates against my schema properly:
try {
SAXReader saxReader = new SAXReader();
if (isSchemaValidating()) {
saxReader.setEntityResolver(new DTDEntityResolver());
saxReader.setValidation(true);
saxReader.setFeature("http://apache.org/xml/features/validation/schema",true);
}
saxReader.setMergeAdjacentText(true);
elements.put(fileInputStream.getKey(), saxReader.read(fileInputStream.getValue()).getRootElement());
} catch (DocumentException dex) {
Throwable nested = dex.getNestedException();
if (nested != null) {
if (nested instanceof FileNotFoundException) {
throw new RuntimeException(
"Can't find schema/DTD reference for file: "
+ fileInputStream.getKey() + "': "
+ nested.getMessage(), dex
);
} else if (nested instanceof UnknownHostException) {
throw new RuntimeException(
"Cannot connect to host from schema/DTD reference: "
+ nested.getMessage()
+ " - check that your schema/DTD reference is current", dex
);
}
}
throw new RuntimeException("Could not parse XML file: " + fileInputStream.getKey() ,dex);
} catch (Exception ex) {
throw new RuntimeException("Could not parse XML file: " + fileInputStream.getKey() ,ex);
}
I can use that with the classpath:// feature of the DTDEntityResolver (which is the same as in Hibernate):
<?xml version="1.0" encoding="UTF-8"?>
<plugin key="hw" label="Hello World"
xmlns="http://jboss.com/products/seam/wiki/plugin"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://jboss.com/products/seam/wiki/plugin classpath://org/jboss/seam/wiki/core/plugin/plugin-1.0.xsd">
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 10 months