[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-978) StringIndexOutOfBoundsException in org.jboss.seam.ui.UISelectDate.commaSeparate(String[] values, int maxLength)
by Leszek Kowalski (JIRA)
StringIndexOutOfBoundsException in org.jboss.seam.ui.UISelectDate.commaSeparate(String[] values, int maxLength)
---------------------------------------------------------------------------------------------------------------
Key: JBSEAM-978
URL: http://jira.jboss.com/jira/browse/JBSEAM-978
Project: JBoss Seam
Issue Type: Bug
Components: JSF
Affects Versions: 1.2.0.GA
Environment: Seam 1.2.0patch1, Jetty 5.1.12, polish locale set in faces-config.xml
Reporter: Leszek Kowalski
In Polish abbreviation for Sunday is just "N" so val.substring(0,2) fails:
Stacktrace:
java.lang.StringIndexOutOfBoundsException: String index out of range: 2
at java.lang.String.substring(Unknown Source)
at org.jboss.seam.ui.UISelectDate.commaSeparate(UISelectDate.java:141)
at org.jboss.seam.ui.UISelectDate.writeLocaleInformation(UISelectDate.java:118)
at org.jboss.seam.ui.UISelectDate.writeScript(UISelectDate.java:98)
at org.jboss.seam.ui.UISelectDate.encodeBegin(UISelectDate.java:70)
(.....)
The fix is trivial:
if (!"".equals(val))
{
if (sb.length() > 0) sb.append(',');
+ int length = val.length();
+ sb.append(maxLength == -1 ? val : val.substring(0, length < maxLength ? length : maxLength));
- sb.append(maxLength == -1 ? val : val.substring(0, maxLength));
}
--
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
19 years, 1 month
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-948) NPE in Facelets if no redirect after file upload
by Christian Bauer (JIRA)
NPE in Facelets if no redirect after file upload
------------------------------------------------
Key: JBSEAM-948
URL: http://jira.jboss.com/jira/browse/JBSEAM-948
Project: JBoss Seam
Issue Type: Bug
Components: JSF
Reporter: Christian Bauer
Assigned To: Shane Bryzak
This happens after a file upload action, if we don't redirect but render a page (the seamspace demo is redirecting). It does not matter which page is rendered after the file upload.
fileEdit.xhtml:
<h:form enctype="multipart/form-data">
<s:validateAll>
<s:decorate>
<div class="entry">
<div class="label">Name:</div>
<div class="input">
<h:inputText tabindex="1" size="80" maxlength="255" id="name" required="true"
value="#{fileHome.instance.name}"/>
</div>
</div>
</s:decorate>
<s:decorate>
<div class="entry">
<div class="label">Upload:</div>
<div class="input">
<s:fileUpload data="#{fileHome.instance.data}"
contentType="#{fileHome.instance.contentType}"
fileName="#{fileHome.instance.filename}"
fileSize="#{fileHome.instance.filesize}"/>
</div>
</div>
</s:decorate>
...
FileHome is just a Home<File> subclass, nothing interesting. When I submit this form, the upload is done and the home.persist() method completes OK (I have everything in the database). The render response, which is fileEdit.xhtml again, fails with this:
java.lang.NullPointerException
at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:168)
at com.sun.facelets.util.DevTools.writeVariables(DevTools.java:144)
at com.sun.facelets.util.DevTools.debugHtml(DevTools.java:109)
at com.sun.facelets.FaceletViewHandler.handleRenderException(FaceletViewHandler.java:671)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:639)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:130)
at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:107)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:78)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:383)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:74)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:613)
Looks like there is a problem rendering the view and then an NPE in Facelets which hides the error.
--
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
19 years, 1 month
[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-888) Various security/login-related issues
by Christian Bauer (JIRA)
Various security/login-related issues
-------------------------------------
Key: JBSEAM-888
URL: http://jira.jboss.com/jira/browse/JBSEAM-888
Project: JBoss Seam
Issue Type: Bug
Components: Security
Reporter: Christian Bauer
Priority: Minor
Various issues I found while using the new security stuff:
1. NPE in RuleBasedIdentity, line 155: getSecurityContext().assertObject(new Role(role)); if the security-rules.drl can't be found.
2. Do we need to call modify(c) on the RHS after c.grant() or not? The 12.5.3 example doesn't have it.
3. The copy/pasted seamspace example in the "Securing Entities" section is very cryptic. Please don't use variable names such as "nm" and "mbr" in examples. Good documentation also means that every code snippet is explained after the code block.
4. The exception handling doesn't allow me to simply re-render the page, I need to do a redirect. I don't want this if my default page template has a login box always present (so I don't need login.xhtml) and if my default template can show global faces messages ("You don't have permission to do this"). In fact, the whole redirect/captureView stuff conflicts with my application because I'm already using it to keep my own navigation history. I can't use it to redirect/return from and to some login page.
Example of the last issue: User browses documents, clicks on EDIT, is redirected to the Login page, is redirected to the EDIT page. Now I've lost my history and can't redirect the user back to browsing the document when he exists the EDIT page.
--
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
19 years, 1 month