Skip to content

Copy ServletHolder class/instance properly during startWebapp - #6214

Merged
gregw merged 10 commits into
jetty-9.4.xfrom
jetty-9.4.x-jsp-precompile-alt-servlet
May 16, 2021
Merged

gregw merged 10 commits into
jetty-9.4.xfrom
jetty-9.4.x-jsp-precompile-alt-servlet

Conversation

@joakime

@joakime joakime commented Apr 26, 2021 •

Copy link
Copy Markdown
Contributor

joakime added 5 commits April 21, 2021 10:11
…tor.

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
- using status code 555 for testcase
  eliminating 503 false success
  from different code path than
  what we are attempting to fix

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
- ServletHolder needs a mapping
  to allow RejectUncompiledJspServlet
  to respond to requests for JSPs
  that haven't been precompiled.
- Precompiled test class is now
  properly placed into a generated
  webapp base directory without
  contaminating the webapp classloader
  with other src/test/java classes

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
@joakime
joakime requested a review from gregw April 26, 2021 22:49
@joakime joakime self-assigned this Apr 26, 2021
gregw
gregw previously requested changes Apr 27, 2021

@gregw gregw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janbartel can you review this and then let's chat. I think we need to think very carefully about what it means to have 2 holders sharing the same instance.

Comment thread jetty-webapp/src/test/java/org/eclipse/jetty/webapp/ForcedServletTest.java Outdated
Comment thread jetty-webapp/src/test/java/org/eclipse/jetty/webapp/ForcedServletTest.java Outdated
Comment thread jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java Outdated
Comment thread jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java Outdated
Comment thread jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java Outdated
Comment thread jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHolder.java Outdated
Comment thread jetty-webapp/src/test/resources/alt-jsp-webdefault.xml Outdated
Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw
gregw requested a review from janbartel April 27, 2021 04:39
@gregw
gregw marked this pull request as ready for review April 27, 2021 04:40
@gregw
gregw dismissed their stale review April 27, 2021 04:40

I'm now an author

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Comment thread jetty-webapp/src/test/java/org/eclipse/jetty/webapp/jsp/FakeJspServlet.java Outdated
Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw
gregw requested a review from janbartel April 28, 2021 08:38
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>

@janbartel janbartel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of the remaining test servlet classes could be inner classes too.

@@ -0,0 +1,37 @@
//

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this an inner class.

@@ -0,0 +1,37 @@
//

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this one an inner class of ForcedServletTest too.

use inner classes

Signed-off-by: Greg Wilkins <gregw@webtide.com>
@gregw
gregw requested a review from janbartel May 15, 2021 22:14

@janbartel janbartel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gregw
gregw merged commit edcaf70 into jetty-9.4.x May 16, 2021
@gregw
gregw deleted the jetty-9.4.x-jsp-precompile-alt-servlet branch May 16, 2021 01:28
@gregw gregw linked an issue May 16, 2021 that may be closed by this pull request
gregw pushed a commit that referenced this pull request May 16, 2021
 ServletHolder.copyClassServlet() method added to correctly copy held class.


Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Signed-off-by: Greg Wilkins <gregw@webtide.com>
gregw added a commit that referenced this pull request May 16, 2021
Copy ServletHolder class/instance properly during startWebapp (#6214)
ServletHolder.copyClassServlet() method added to correctly copy held class.
Cherry picked from 9.4

Signed-off-by: Greg Wilkins <gregw@webtide.com>
Co-authored-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy ServletHolder class/instance properly during startWebapp

3 participants