Skip to content

Fix ServletUriComponentsBuilder examples in ref docs#27984

Closed
wkwkhautbois wants to merge 1 commit intospring-projects:mainfrom
wkwkhautbois:fix-example-of-servleturicomponentsbuilder
Closed

Fix ServletUriComponentsBuilder examples in ref docs#27984
wkwkhautbois wants to merge 1 commit intospring-projects:mainfrom
wkwkhautbois:fix-example-of-servleturicomponentsbuilder

Conversation

@wkwkhautbois
Copy link
Copy Markdown
Contributor

Fix ServletUriComponentsBuilder examples in reference docs.

Fixed two problems.

  • Type mismatch
  • Comments are inaccurate

before

// Re-uses host, port and context path...

ServletUriComponentsBuilder ucb = ServletUriComponentsBuilder.fromContextPath(request)
        .path("/accounts").build()

after

// Re-uses host, port, scheme and context path...

URI uri = ServletUriComponentsBuilder.fromContextPath(request)
        .path("/accounts")
        .build()
        .toUri();

@pivotal-cla
Copy link
Copy Markdown

@wkwkhautbois Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link
Copy Markdown

@wkwkhautbois Thank you for signing the Contributor License Agreement!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 28, 2022
@sbrannen sbrannen added the type: documentation A documentation task label Jan 28, 2022
@sbrannen sbrannen changed the title Fix examples of ServletUriComponentsBuilder. Fix ServletUriComponentsBuilder examples in ref docs Jan 28, 2022
@sbrannen sbrannen self-assigned this Jan 28, 2022
@sbrannen sbrannen added in: web Issues in web modules (web, webmvc, webflux, websocket) and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 28, 2022
@sbrannen sbrannen added this to the 5.3.16 milestone Jan 28, 2022
sbrannen added a commit to sbrannen/spring-framework that referenced this pull request Jan 28, 2022
@sbrannen sbrannen closed this in fadfcf4 Jan 28, 2022
@sbrannen
Copy link
Copy Markdown
Member

Good catch!

This has been merged into 5.3.x and main.

Thanks for making your first contribution to the Spring Framework. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) type: documentation A documentation task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants