Liferay container is so strict regards ServletResponse::setContentLength comparing to normal servlet containers and Apache Pluto portal, thus the PortalUidlRequestHandler works incorrectly in case of exception in the server-side listener: it writes the error meta info JSON into response, then appends sync UIDL JSON message, then calls setContentLength with the length of the sync UIDL message. Which in turn leads to an unpredictable JSON sent to client.
When this change is applied, UidlRequestHandler doesn't write sync UIDL message to the response once the RPC handler execution throws, but instead sends only an error message to the client.
No IT tests added, because this is covered by LiferayErrorHandlingIT being added afterwards within Liferay tests PR.
Description
Liferay container is so strict regards
ServletResponse::setContentLength
comparing to normal servlet containers and Apache Pluto portal, thus thePortalUidlRequestHandler
works incorrectly in case of exception in the server-side listener: it writes the error meta info JSON into response, then appends sync UIDL JSON message, then callssetContentLength
with the length of the sync UIDL message. Which in turn leads to an unpredictable JSON sent to client.When this change is applied,
UidlRequestHandler
doesn't write sync UIDL message to the response once the RPC handler execution throws, but instead sends only an error message to the client.No IT tests added, because this is covered by
LiferayErrorHandlingIT
being added afterwards within Liferay tests PR.Fixes #213
Type of change
Checklist
Additional for
Feature
type of change