Skip to content

Getting path parameter from RoutingContext #29368

Answered by geoand
kyngs asked this question in Q&A
Discussion options

You must be logged in to vote

I haven't tried it, but:

    public static class PathSegmentProducer {

        @RequestScoped
        List<PathSegment> pathSegments(UriInfo uriInfo) {
            return uriInfo.getPathSegments();
        }
    }

should allow you to inject List<PathSegment> into any CDI bean.

I'll warn you though that is not really a supported use case, so if someone comes to me in the future saying it doesn't work, I can't say I'll go out of my way to fix it :)

Replies: 3 comments 16 replies

Comment options

You must be logged in to vote
1 reply
@kyngs
Comment options

Comment options

You must be logged in to vote
1 reply
@kyngs
Comment options

Comment options

You must be logged in to vote
14 replies
@jonjanisch
Comment options

@kyngs
Comment options

@jonjanisch
Comment options

@geoand
Comment options

geoand Dec 15, 2023
Collaborator

Answer selected by kyngs
@kyngs
Comment options

@geoand
Comment options

geoand Dec 15, 2023
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants