-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.0.0 DXP SP2, Master
-
Fix Version/s: 7.0.0 DXP FP10, 7.0.0 DXP SP2, 7.0.3 CE GA4, 7.1.X, Master
-
Component/s: Core Infrastructure, Core Infrastructure > Wab Extender
-
Branch Version/s:7.0.x
-
Backported to Branch:Committed
-
Story Points:1
-
Fix Priority:3
-
Git Pull Request:
Servlet 3 api allows to set init parameters (those with <context-param> if coming from web.xml) while servletContext isn't initialized yet.
For example, If doing so from a servletContainerInitializer, it will throw an IllegalStateException.
This will make many frameworks (like Spring Boot like here: https://github.com/spring-projects/spring-boot/blob/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java#L229) to not work, as they use this API method.
Steps to reproduce
- Deploy attached portlet (com.lps69270.sample-1.0-SNAPSHOT.war).
- Access http://localhost:8080/o/com.lps69270.sample-1.0-SNAPSHOT/foo
Expected behaviour: you should see 3 messages like this at the end of the page:
setting context Init param works! context Init param is visible from Listener! context attribute was set properly from Initializer!
Actual behaviour: those three messages doesn't show exactly like that, stating some of those doesn't work.
First seen in forums: https://web.liferay.com/community/forums/-/message_boards/view_message/81031101