Issue Details (XML | Word | Printable)

Key: SPR-941
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Juergen Hoeller
Reporter: Shinobu Kawai
Votes: 2
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Spring Framework

VelocityToolboxViewResolver and VelocityLayoutViewResolver

Created: 12/May/05 12:44 PM   Updated: 23/Feb/06 01:35 PM   Resolved: 23/Feb/06 01:35 PM
Component/s: SpringWEB
Affects Version/s: None
Fix Version/s: 1.2.7, 2.0 M3

Time Tracking:
Not Specified

File Attachments: 1. Text File SPR-941.VelocityViewResolver.patch (2 kB)
2. Text File SPR-941.VelocityViewResolver.patch (2 kB)
3. Java Source File VelocityLayoutViewResolver.java (4 kB)
4. Java Source File VelocityLayoutViewResolver.java (4 kB)
5. Java Source File VelocityToolboxViewResolver.java (3 kB)
6. Java Source File VelocityToolboxViewResolver.java (3 kB)

Environment: using VelocityTools toolbox and layout support


 Description  « Hide

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.



Shinobu Kawai added a comment - 12/May/05 12:46 PM

move toolbox support to VelocityToolboxViewResolver


Shinobu Kawai added a comment - 12/May/05 12:48 PM

view resolver w/ toolbox support


Shinobu Kawai added a comment - 12/May/05 12:48 PM

view resolver w/ layout support


Shinobu Kawai added a comment - 24/May/05 01:19 PM

replaces attach #1 for Spring 1.2 (CVS HEAD)


Shinobu Kawai added a comment - 24/May/05 01:22 PM

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


Shinobu Kawai added a comment - 24/May/05 01:22 PM

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


Juergen Hoeller added a comment - 25/May/05 03:46 AM

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


Shinobu Kawai added a comment - 25/May/05 12:03 PM

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.


Juergen Hoeller added a comment - 23/Feb/06 01:35 PM

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