Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Possible regression in "redirect" views between Spring 3.0.2 and Spring 3.0.4 [SPR-7532] #12190

Closed
spring-projects-issues opened this issue Sep 8, 2010 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Sep 8, 2010

Grant Gochnauer opened SPR-7532 and commented

In Spring 3.0.2, our MVC controllers returned a redirect view via the XML definition as follows:

<property name="redeemedView" value="redirect: /promo/us/avivaSkinsRedeemed.htm"/>

The redirect included the context path of the application: "promo". However in Spring 3.0.4, we've found that we've had to go through and change all the redirects to exclude the context path. So now our redirect looks like:

<property name="redeemedView" value="redirect:/us/avivaSkinsRedeemed.htm"/>

So we had to remove the context path from the redirect. Is it correct that we'd normally want to include a context path when issuing a redirect call?

Thank you!


Affects: 3.0.4

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Sep 8, 2010

Juergen Hoeller commented

I suspect that this has something to do with the 3.0.4 changes in RedirectView which recently got reverted to the 3.0.3 version as part of #12148. There were no other changes in RedirectView since 3.0 RC1, so I can't imagine any other reason. If you could give a recent 3.0.5 snapshot a try and check whether the problem remains there, that would be great!

A special note: It looks like the only reason why it did work for you with 3.0.2 is that your path starts with " /" instead of "/". "redirect:" URLs are defined to be context-relative by default, unless your ViewResolver is configured with "redirectContextRelative"="false". However, there is a getUrl().startsWith("/") check, so the prepended blank in your URLs might have been a workaround for that - and it's likely that 3.0.4 accidentally broke that workaround. It's probably better to configure this at the ViewResolver level, even if 3.0.5 allows for the workaround again...

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Grant Gochnauer commented

Hi Juergen,

Where can I find the latest nightly snapshot? Normally I've used:
http://static.springsource.org/downloads/nightly/snapshot-download.php?project=SPR

but it appears it has stopped updating.

Thanks in advance,
Grant

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: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants