Re: BUG in struts-2.5.15

2018-02-14 Thread liemnguyen
Martin Gainty,

I found 
"C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar".
 I believe struts-default.xml is within struts2-core.jar (renamed from 
struts2-core-2.5.15.jar).

I believe this bug is similar to https://issues.apache.org/jira/browse/WW-4901 
in struts-2.5.14.1 and struts-2.5.14.

When I tested upgrading to struts-2.5.14.1 (or struts-2.5.14), I see similar 
error described in WW-4901.

Struts-2.5.13 did not have this bug.

I thought this bug is fixed in struts-2.5.15. Somehow, I still see it in 
struts-2.5.15 when deploying to Weblogic server.

Thanks,
Liem.


From: Martin Gainty 
Subject: Re: BUG in struts-2.5.15
Date: 2018/02/14 21:09:55
List: 
user@struts.apache.org








From: liemngu...@ups.com.INVALID 

Sent: Wednesday, February 14, 2018 10:43 AM

To: user@struts.apache.org

Subject: BUG in struts-2.5.15



Hi all,



Testing your upcoming struts-2.5.15, when starting Weblogic server (Weblogic 
server version 12.2.1.2.0, JDK v 1.8.0_101), we see exception below.



MG>asking the obvious ..do you have:



C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar!/struts-default.xml



MG>located on your WINDOWS-OS Weblogic server?




Re: BUG in struts-2.5.15

2018-02-14 Thread Martin Gainty



From: liemngu...@ups.com.INVALID 
Sent: Wednesday, February 14, 2018 10:43 AM
To: user@struts.apache.org
Subject: BUG in struts-2.5.15

Hi all,

Testing your upcoming struts-2.5.15, when starting Weblogic server (Weblogic 
server version 12.2.1.2.0, JDK v 1.8.0_101), we see exception below.

MG>asking the obvious ..do you have:

C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar!/struts-default.xml

MG>located on your WINDOWS-OS Weblogic server?

Thanks,
Liem.


2018-02-14 10:28:37.194 WARN  - Could not create JarEntryRevision for 
[zip:C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar!/struts-default.xml]!
java.net.MalformedURLException: unknown protocol: c
at java.net.URL.(URL.java:600) ~[?:1.8.0_101]
at java.net.URL.(URL.java:490) ~[?:1.8.0_101]
at java.net.URL.(URL.java:439) ~[?:1.8.0_101]
at 
java.net.JarURLConnection.parseSpecs(JarURLConnection.java:175) ~[?:1.8.0_101]
at java.net.JarURLConnection.(JarURLConnection.java:158) 
~[?:1.8.0_101]
at 
com.opensymphony.xwork2.util.fs.StrutsJarURLConnection.(StrutsJarURLConnection.java:44)
 ~[struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.StrutsJarURLConnection.openConnection(StrutsJarURLConnection.java:99)
 ~[struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:42)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.DefaultFileManager.monitorFile(DefaultFileManager.java:94)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:73)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1054)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:198)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:165)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:166)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:957) 
[struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:463)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:496) 
[struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:73)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:61)
 [struts2-core.jar:2.5.15]
at 
weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:400)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
 [com.oracle.weblogic.security.subject.jar:12.2.1.0]
at 
weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:196)
 [com.oracle.weblogic.security.subject.jar:12.2.1.0]
at 
weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.initFilter(FilterManager.java:130) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:92) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:72) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1917)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3063)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
 

Re: Conversion Error Interceptor prevent errors for empty values

2018-02-14 Thread Yasser Zamani


On 2/14/2018 5:13 PM, Paul Zepernick wrote:
> Yes, I have it happening on 2.5.14.1.  I have a select box pointing at a 
> Integer like this: auditForm.incorrectAuditReason.id  I am using the rest 
> plugin which is including it in the stack.  I have attached the source from 
> Maven.  Where is the check being done in the code?  I see the check for 
> shouldAddError() always returning true.
> 

No you should check
`org.apache.struts2.interceptor.StrutsConversionErrorInterceptor`
(prefixed with `Struts`) instead. Could you put a break point on it's
`shouldAddError` method and see what happens when you post
auditForm.incorrectAuditReason.id?

> I have attempted to override the default interceptor by adding this in my 
> package and overriding the shouldAddError(), but it continues to call the 
> default Struts ConversionErrorInterceptor.
> 
>  class="com.hs.iws.struts2.IwsConversionErrorInterceptor"/>
>
I think you should define your stack including your new interceptor and
ref it in your action definition.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



BUG in struts-2.5.15

2018-02-14 Thread liemnguyen
Hi all,

Testing your upcoming struts-2.5.15, when starting Weblogic server (Weblogic 
server version 12.2.1.2.0, JDK v 1.8.0_101), we see exception below.

Thanks,
Liem.


2018-02-14 10:28:37.194 WARN  - Could not create JarEntryRevision for 
[zip:C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar!/struts-default.xml]!
java.net.MalformedURLException: unknown protocol: c
at java.net.URL.(URL.java:600) ~[?:1.8.0_101]
at java.net.URL.(URL.java:490) ~[?:1.8.0_101]
at java.net.URL.(URL.java:439) ~[?:1.8.0_101]
at 
java.net.JarURLConnection.parseSpecs(JarURLConnection.java:175) ~[?:1.8.0_101]
at java.net.JarURLConnection.(JarURLConnection.java:158) 
~[?:1.8.0_101]
at 
com.opensymphony.xwork2.util.fs.StrutsJarURLConnection.(StrutsJarURLConnection.java:44)
 ~[struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.StrutsJarURLConnection.openConnection(StrutsJarURLConnection.java:99)
 ~[struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:42)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.DefaultFileManager.monitorFile(DefaultFileManager.java:94)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:73)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1054)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:198)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:165)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:166)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:957) 
[struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:463)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:496) 
[struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:73)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:61)
 [struts2-core.jar:2.5.15]
at 
weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:400)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
 [com.oracle.weblogic.security.subject.jar:12.2.1.0]
at 
weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:196)
 [com.oracle.weblogic.security.subject.jar:12.2.1.0]
at 
weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.initFilter(FilterManager.java:130) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:92) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:72) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1917)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3063)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1830) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:875) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:360)
 [com.oracle.weblogic.application.jar:12.2.1.0]
at 

BUG in struts-2.5.15

2018-02-14 Thread liemnguyen
Hi all,

Testing your upcoming struts-2.5.15, when starting Weblogic server (Weblogic 
server version 12.2.1.2.0, JDK v 1.8.0_101), we see exception below.

Thanks,
Liem.


2018-02-14 10:28:37.194 WARN  - Could not create JarEntryRevision for 
[zip:C:/Oracle/Middleware/Oracle_Home12.2.1.0.0/user_projects/domains/iwa_local_domain/servers/AdminServer/tmp/_WL_user/IWA/zfd81u/war/WEB-INF/lib/struts2-core.jar!/struts-default.xml]!
java.net.MalformedURLException: unknown protocol: c
at java.net.URL.(URL.java:600) ~[?:1.8.0_101]
at java.net.URL.(URL.java:490) ~[?:1.8.0_101]
at java.net.URL.(URL.java:439) ~[?:1.8.0_101]
at 
java.net.JarURLConnection.parseSpecs(JarURLConnection.java:175) ~[?:1.8.0_101]
at java.net.JarURLConnection.(JarURLConnection.java:158) 
~[?:1.8.0_101]
at 
com.opensymphony.xwork2.util.fs.StrutsJarURLConnection.(StrutsJarURLConnection.java:44)
 ~[struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.StrutsJarURLConnection.openConnection(StrutsJarURLConnection.java:99)
 ~[struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:42)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.DefaultFileManager.monitorFile(DefaultFileManager.java:94)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:73)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1054)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:198)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:165)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:166)
 [struts2-core.jar:2.5.15]
at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:957) 
[struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:463)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:496) 
[struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:73)
 [struts2-core.jar:2.5.15]
at 
org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:61)
 [struts2-core.jar:2.5.15]
at 
weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:400)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
 [com.oracle.weblogic.security.subject.jar:12.2.1.0]
at 
weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:196)
 [com.oracle.weblogic.security.subject.jar:12.2.1.0]
at 
weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.initFilter(FilterManager.java:130) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.loadFilter(FilterManager.java:92) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.FilterManager.preloadFilters(FilterManager.java:72) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1917)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3063)
 [com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1830) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:875) 
[com.oracle.weblogic.servlet.jar:12.2.1.0]
at 
weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:360)
 [com.oracle.weblogic.application.jar:12.2.1.0]
at 

RE: Conversion Error Interceptor prevent errors for empty values

2018-02-14 Thread Paul Zepernick
Trying the attachment again as a txt

Paul R. Zepernick
Sr. Programmer Analyst
HealthSmart Benefit Solutions

-Original Message-
From: Paul Zepernick [mailto:paul.zepern...@healthsmart.com] 
Sent: Wednesday, February 14, 2018 8:44 AM
To: user@struts.apache.org
Subject: RE: Conversion Error Interceptor prevent errors for empty values

Yes, I have it happening on 2.5.14.1.  I have a select box pointing at a 
Integer like this: auditForm.incorrectAuditReason.id  I am using the rest 
plugin which is including it in the stack.  I have attached the source from 
Maven.  Where is the check being done in the code?  I see the check for 
shouldAddError() always returning true.

I have attempted to override the default interceptor by adding this in my 
package and overriding the shouldAddError(), but it continues to call the 
default Struts ConversionErrorInterceptor.





Paul R. Zepernick
Sr. Programmer Analyst
HealthSmart Benefit Solutions

-Original Message-
From: Yasser Zamani [mailto:yasser.zam...@live.com] On Behalf Of Yasser Zamani
Sent: Wednesday, February 14, 2018 4:25 AM
To: user@struts.apache.org
Subject: Re: Conversion Error Interceptor prevent errors for empty values



On 2/13/2018 8:06 PM, Paul Zepernick wrote:
> Can someone provide some clarification on if this interceptor should be 
> adding a field error when an empty string is passed to a Integer in the 
> action?

No, it should not be happening for `conversionError` interceptor. Does it 
happen?

>   I am trying to prevent the field error from happening in this case.  It 
> looks like it should not be happening according to the docs: 
> https://struts.apache.org/core-developers/conversion-error-interceptor.html , 
> or am I not understanding what it is saying here:
>
> "This interceptor extends ConversionErrorInterceptor but only adds conversion 
> errors from the ActionContext to the field errors of the action if the field 
> value is not null, "", or {""} (a size 1 String array with only an empty 
> String). See ConversionErrorInterceptor for more information, as well as the 
> Type Conversion documentation"

You understood correctly. I reviewed it's code and looks like it should behave 
as above. Doesn't it?

I also saw `conversionError` is already included in default stack.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




Disclaimer: This communication and any files transmitted with it may contain 
information that is privileged, confidential and/or exempt from disclosure 
under applicable law. If you are not the intended recipient, you are hereby 
notified that any disclosure, copying, distribution, or use of the information 
contained herein (including any reliance thereon) is strictly prohibited. If 
you received this communication in error, please immediately contact the sender 
and destroy the material in its entirety, whether in electronic or hard copy 
format. Thank you.

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package com.opensymphony.xwork2.interceptor;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.commons.lang3.StringEscapeUtils;

import java.util.HashMap;
import java.util.Map;


/**
 * 
 * ConversionErrorInterceptor adds conversion errors from the ActionContext to 
the Action's field errors.
 *
 * 
 * This interceptor adds any error found in the {@link ActionContext}'s 
conversionErrors map as a field error (provided
 * that the action implements {@link ValidationAware}). In addition, any field 
that contains a validation error has its
 * original value saved such that any subsequent requests for that value return 
the original value rather than the value
 * in the action. This is important because if the value "abc" is submitted and 
can't be converted to an int, we want to
 * display the original string ("abc") again rather than the int value (likely 
0, which would make very little sense to
 * the user).
 * 
 * 
 * 
 * Note: Since 2.5.2, 

RE: Conversion Error Interceptor prevent errors for empty values

2018-02-14 Thread Paul Zepernick
Yes, I have it happening on 2.5.14.1.  I have a select box pointing at a 
Integer like this: auditForm.incorrectAuditReason.id  I am using the rest 
plugin which is including it in the stack.  I have attached the source from 
Maven.  Where is the check being done in the code?  I see the check for 
shouldAddError() always returning true.

I have attempted to override the default interceptor by adding this in my 
package and overriding the shouldAddError(), but it continues to call the 
default Struts ConversionErrorInterceptor.





Paul R. Zepernick
Sr. Programmer Analyst
HealthSmart Benefit Solutions

-Original Message-
From: Yasser Zamani [mailto:yasser.zam...@live.com] On Behalf Of Yasser Zamani
Sent: Wednesday, February 14, 2018 4:25 AM
To: user@struts.apache.org
Subject: Re: Conversion Error Interceptor prevent errors for empty values



On 2/13/2018 8:06 PM, Paul Zepernick wrote:
> Can someone provide some clarification on if this interceptor should be 
> adding a field error when an empty string is passed to a Integer in the 
> action?

No, it should not be happening for `conversionError` interceptor. Does it 
happen?

>   I am trying to prevent the field error from happening in this case.  It 
> looks like it should not be happening according to the docs: 
> https://struts.apache.org/core-developers/conversion-error-interceptor.html , 
> or am I not understanding what it is saying here:
>
> "This interceptor extends ConversionErrorInterceptor but only adds conversion 
> errors from the ActionContext to the field errors of the action if the field 
> value is not null, "", or {""} (a size 1 String array with only an empty 
> String). See ConversionErrorInterceptor for more information, as well as the 
> Type Conversion documentation"

You understood correctly. I reviewed it's code and looks like it should behave 
as above. Doesn't it?

I also saw `conversionError` is already included in default stack.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org




Disclaimer: This communication and any files transmitted with it may contain 
information that is privileged, confidential and/or exempt from disclosure 
under applicable law. If you are not the intended recipient, you are hereby 
notified that any disclosure, copying, distribution, or use of the information 
contained herein (including any reliance thereon) is strictly prohibited. If 
you received this communication in error, please immediately contact the sender 
and destroy the material in its entirety, whether in electronic or hard copy 
format. Thank you.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Re: Conversion Error Interceptor prevent errors for empty values

2018-02-14 Thread Yasser Zamani


On 2/13/2018 8:06 PM, Paul Zepernick wrote:
> Can someone provide some clarification on if this interceptor should be 
> adding a field error when an empty string is passed to a Integer in the 
> action?

No, it should not be happening for `conversionError` interceptor. Does
it happen?

>   I am trying to prevent the field error from happening in this case.  It 
> looks like it should not be happening according to the docs: 
> https://struts.apache.org/core-developers/conversion-error-interceptor.html , 
> or am I not understanding what it is saying here:
> 
> "This interceptor extends ConversionErrorInterceptor but only adds conversion 
> errors from the ActionContext to the field errors of the action if the field 
> value is not null, "", or {""} (a size 1 String array with only an empty 
> String). See ConversionErrorInterceptor for more information, as well as the 
> Type Conversion documentation"

You understood correctly. I reviewed it's code and looks like it should
behave as above. Doesn't it?

I also saw `conversionError` is already included in default stack.


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org