Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(ServletAdapter): Ability remove context path when get method name #11825

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

long76
Copy link

@long76 long76 commented Jan 14, 2025

Refs: #5066

Complex application may have many war-s and do not allow monopolize root context path(/). Add ability to remove context path(usual it's war name) from application server use @WebInitParam or just override getInitParameter for parameter GrpcServlet.REMOVE_CONTEXT_PATH

requestURI = contextPath + servletPath + pathInfo

Usage example:

@WebServlet(urlPatterns = "/*", asyncSupported = true,
        initParams = @WebInitParam(name = GrpcServlet.REMOVE_CONTEXT_PATH, value = "true"))
public class GrpcWebServlet extends GrpcServlet {
...
}

Links:
https://stackoverflow.com/a/42706412
https://coderanch.com/t/610432/certification/getContextPath-getServletPath-getPathInfo

@long76
Copy link
Author

long76 commented Jan 15, 2025

don't understand why crash tests) error in test env?

@long76
Copy link
Author

long76 commented Jan 29, 2025

don't understand why crash tests) error in test env?

found error - getInitParameter throw exception on tests

Copy link
Contributor

@kannanjgithub kannanjgithub left a comment

Choose a reason for hiding this comment

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

Left a minor comment.

kannanjgithub
kannanjgithub previously approved these changes Mar 11, 2025
@kannanjgithub kannanjgithub requested a review from ejona86 March 11, 2025 11:53
@kannanjgithub kannanjgithub added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Mar 12, 2025
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Mar 12, 2025
@kannanjgithub kannanjgithub dismissed their stale review March 12, 2025 06:56

Need a few more changes.

Copy link
Contributor

@kannanjgithub kannanjgithub left a comment

Choose a reason for hiding this comment

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

Some more changes.

@long76 long76 requested a review from kannanjgithub March 12, 2025 07:35
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants