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

VelocityToolboxViewResolver and VelocityLayoutViewResolver [SPR-941] #5660

Closed
spring-projects-issues opened this issue May 12, 2005 · 9 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Shinobu Kawai opened SPR-941 and commented

Currently, you can't inject a configured VelocityLayoutView into the VelocityViewResolver. (Or can you?)

I created a VelocityToolboxViewResolver and a VelocityLayoutViewResolver to solve my problem. The whole structure kind of smells, but it looks clean for now. :)

For the VelocityToolboxViewResolver, you can add the "toolboxConfigLocation" property to specify your toolbox.xml as you would in VelocityToolboxView. This causes some backward incompatability, as I moved the property down from VelocityViewResolver, but all you have to do is change the view resolver class name. (And it was added in 1.2rc2 anyways.)

For the VelocityLayoutViewResolver, in addition to the toolbox stuff, you can add the "layoutUrl", "layoutKey" and "screenContentKey" properties in respect with the same properties of VelocityLayoutView.


Attachments:

2 votes, 3 watchers

@spring-projects-issues
Copy link
Collaborator Author

Shinobu Kawai commented

move toolbox support to VelocityToolboxViewResolver

@spring-projects-issues
Copy link
Collaborator Author

Shinobu Kawai commented

view resolver w/ toolbox support

@spring-projects-issues
Copy link
Collaborator Author

Shinobu Kawai commented

view resolver w/ layout support

@spring-projects-issues
Copy link
Collaborator Author

Shinobu Kawai commented

replaces attach #1 for Spring 1.2 (CVS HEAD)

@spring-projects-issues
Copy link
Collaborator Author

Shinobu Kawai commented

replaces VelocityToolboxViewResolver.java uploaded on 12/May/05 for Spring 1.2 (CVS HEAD)

@spring-projects-issues
Copy link
Collaborator Author

Shinobu Kawai commented

replaces VelocityLayoutViewResolver.java uploaded on 12/May/05 for Spring 1.2 (CVS HEAD)

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

A VelocityLayoutViewResolver sounds plausible to me. But why have you factored out the "toolboxConfigLocation" support into a VelocityToolboxViewResolver class? Couldn't it simply stay in VelocityViewResolver?

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Shinobu Kawai commented

VelocityViewResolver#setToolboxConfigLocation looked kind of messy on first impression. The behaviour wasn't intuitive, I usually don't expect a setter to change the state of the instance. Maybe logging a warning that the view class was overwritten would have sufficed.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've added a fresh cut of a VelocityLayoutViewResolver to both Spring 2.0 M3 and 1.2.7. I've kept the toolbox support in VelocityViewResolver itself, although with a refined initialization procedure.

Juergen

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 10, 2019
@spring-projects-issues spring-projects-issues added this to the 1.2.7 milestone Jan 10, 2019
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: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants