- added some additional exclusions in struts-default.xml.
- added log warning that specifies the value of maxLength involved if
applyExpressionMaxLength(maxLength) fails.
- added null guards to two handleOgnlException() methods that could
result in an NPE with #371 changes (a null OgnlException parameter
was permissible previously, correct or not).
L. Lenart).
Added comment to explain why the log output avoids a stacktrace (due to
exceptions being re-thrown).
Updated existing ServletRedirectResultTest to supply tests that exercise
the new code paths and demonstrate expected logging.
Changed the log outputs to output full stacktraces (as suggested by
A. Mashchenko and L. Lenart).
Updated existing DefaultStaticContentLoaderTest and created a new
DefaultDispatcherErrorHandlerTest to supply tests that exercise the new
code paths and demonstrate expected logging.
Supply log warning when an IOException or IllegalStateException occurs to
better allow developers to track the failed redirect location and status
details. The exceptions are re-thrown to ensure existing flow-control
behaviour is preserved.
When getWriter() is called, utilize a finally block to ensure close is
called.
suggestion by A. Mashchenko and L. Lenart)
Changed the log outputs in this PR from info level to warn level (as per
suggestion by L. Lenart).
Note: The info level was originally chosen to make it easier to filter out
in the very unlikely case of log flood.
DefaultStaticContentLoader.
Provide informational logging for the processing of the two dispatcher
classes when an http sendError fails for the two known failure types
(IOException, IllegalStateException).
In both circumstances it is beneficial to have the developer aware of the
failures via the logs. These are not events that should be happening on a
regular basis, so there is little risk of a log flood.
DefaultStaticContentLoader didn't catch either exception type previously,
so changing it to make handling the same as DefaultDispatcherErrorHandler.
For DefaultDispatcherErrorHandler the IOException was caught with no
notice of failure previously. Now there will be an info level log output.
Previously the IllegalStateException was not caught, which resulted in the
unrecoverable exception being thrown up to the calling thread, usually
resulting in an ugly stacktrace to stdout/stderr. Now there will be an
info level log output instead.
If devMode is true, the info log outputs will include the exception
parameter to the log, so a stacktrace can be viewed for more details. If
devMode is false (production mode), then only the exception's tostring()
output will be produced.
- Provide cache clearing methods for OgnlUtil (expression cache, BeanInfo
cache).
- Provide methods to check the cache sizes (entry number for expression
cache, BeanInfo cache).
- Provide static method to clear the OgnlRuntime cache (convenience
method).
Moves checking OgnlValueStack.THROW_EXCEPTION_ON_FAILURE outside loop because it shouldn't throw exception on first failure while is trying all root objects.
Returns on first successful call because it's not rational and is confusing user to skip when user method successfully returns null as an actual result.
Fixes WW-4999 via honoring (devMode && logMissingProperties) for OgnlValueStack.THROW_EXCEPTION_ON_FAILURE and REPORT_ERRORS_ON_NO_PROP.
* include ref in path for StrutsApplicationResource as WW-5011 workaround
* add license to newly added xml files in previous commit
* WW-5011 include ref in path via .toURI().getPath()
* WW-5011 check protocol and not throw exception due to lazy file existence
* decrease log file size to pass travis build
- Made "constant" RELOADED static to save an initialization every time.
- Updated clearBundle(final String bundleName) method comment as it
seemed inaccurate, added debug log output when called.
- Introduced protected clearBundle(final String bundleName, Locale locale)
method for use by descendants, with debug log output when called.
- Introduced protected clearMissingBundlesCache() method for use by
descendants, with debug log when called.
- Correct missing verification in buildAllowedMethods()/loadGlobalAllowedMethods() that the nodes are
of type Node.TEXT_NODE (as buildResults() does).
- Made two class fields final, as suggested by IDE.
Note: Unlike some similar constructs in other header fields, media
type parameters do not allow whitespace (even "bad" whitespace)
around the "=" character.
Reference: https://tools.ietf.org/html/rfc7231#section-3.1.1.1
See also: WW-4958
* Proposed fix for WW-5029 for the 2.5.x branch:
- NOTE: If the PR is accepted please credit Maxime Clement for this change as they found
the issue, identified the probable cause/related details and opened the JIRA.
- Updated XWorkConfigurationProvider buildAllowedMethods(), loadGlobalAllowedMethods() so that
they now handle situations when a SAX parser produces multiple elements to represent the tag
body value.
- No changes to unit tests.
* Update commit to fix weakness identified by Maxime Clement:
- Implementation should now properly concatenate the node children values together (as a single unified string)
in both buildAllowedMethods(), loadGlobalAllowedMethods() - before generating the method Set to be added.
- Made some eligible variables final.
* Update commit to provide new unit tests:
- Added unit tests to confirm the fixes for buildAllowedMethods(), loadGlobalAllowedMethods()
- Added Mock DOM classes sufficient for these tests.
- Added unit tests to cover buildResults() and loadGlobalResults().
Proposed fix for WW-5028 for the 2.5.x branch:
- Disable printing stacktrace on exceptions by the Dispatcher by default.
- Printing stacktrace on exception is only enabled with devMode set to true, as suggested by L. Lenart.
- Now prints stacktrace on exception using LOG, as suggested by A. Mashchenko and the the JIRA reporter.
Log level set to debug as recommended by Y. Zamani.
- Added two additional unit tests for Dispatcher devMode and handleException states.
- NOTE: If the PR is accepted please credit Robert Hollencamp (Github @rhollencamp) for this change
as he found the issue, proposed a solution for 2.6 (master), and opened the JIRA.
- Updated HttpParameters, ActionMappingParametersInterceptor to prevent multi-level Parameter wrapping from occuring.
- Added a new ActionMappingParametersInterceptorTest to verify the fix.
- Fixes error 500 processing failures for double-submit results with TokenSessionStoreInterceptor processing
- Fix to InvocationSessionStore, new unit test confirming fix in InvocationSessionStoreTest
- Minor whitespace fix to TokenSessionStoreInterceptor