Velocity 1 « Web « Spring Q&A





1. Calling class methods (static) from inside a velocity view page    stackoverflow.com

Can you call class methods from inside a view page? Specifically ones that are not passed into the view? i.e. In asp.net MVC I can do this: <%= SomeClass.FixDateFormat(ViewData.Model.SomeClass.DateCreated) %>

2. Using Velocity's WebappResourceLoader with Spring    stackoverflow.com

I'm trying to use Velocity to create an email template that is mailed by Spring's JavaMailSender class. The resource loader that I decided to use to find the Velocity template ...

3. How would I autowire a velocity template?    stackoverflow.com

I have a static velocity template that I need to use, so I was wondering if it is possible to autowire it instead of doing:

Template template = velocityEngine.getTemplate("com/templates/template.vm");
thanks

4. How to turn off VelocityViewResolver errors in Spring?    stackoverflow.com

I'm using Velocity and Spring. Within Spring, I'm using the VelocityViewResolver paired with the ContentNegotiatingViewResolver. For the most part, this works great. The only problem is that the ...

5. Getting velocity error at statup "VM_global_library.vm"    stackoverflow.com

i am using velocity with spring. But in eclipse console i get this error. my code works fine but i want to know how to fix it ResourceManager : unable to find ...

6. A tool resembling spring's NamedParameterUtils for regular strings processing?    stackoverflow.com

I would like to replace named parameters in a string with values, like when using Python's % operator. Spring supports something very similar to the functionality I need with NamedParameterUtils, but ...

7. Velocity + spring form values to be passed to spring form object    stackoverflow.com

Velocity + spring integration: I'm new to velocity. I have a requirement to submit a form from velocity template and it should be accessed in controller. I tried doing that by referring some tutorials ...

8. problem with i18n (internationalization) with Spring and Velocity    stackoverflow.com

I am having a problem in setting up internationalization with Spring. Here is my config.

    <bean id="messageSource"
            class="org.springframework.context.support.ResourceBundleMessageSource">
 ...

9. Trouble configuring Velocity with Spring for a JUnit test    stackoverflow.com

I'm using Spring 3.0.5, Maven 3.0.3, JUnit 4 and Velocity 1.6.2. When I run my JUnit test, it is not able to locate a velocity template I created. The ...





10. error handling in spring velocity    stackoverflow.com

I am using spring with velocity. In controllers i am not using ModelAndView because there could be some cases where i want to redirect to the pages that belongs to external ...

11. Velocity Template auto-reload doesn't work    stackoverflow.com

I want to reload velocity template as it's changed. For this I've set the followings, but reload doesn't work when I manually change a .vm file inside META-INF/template/ .

velocimacro.library.autoreload = true
[spring|file|class].resource.loader.cache ...

12. Inject to class created via reflection    stackoverflow.com

I wanted to use my own implementation of StringResourceRepository from Velocity framework. However I need to use in this implementation injected @Repository. Problem is that Velocity creates my class via reflection, ...

13. Velocity templates : how do I put the result of #springMessage() into a velocity variable    stackoverflow.com

I have a value that comes out of this statement :

#springMessage("count.french")
That I need to append to another string like
#set ( $theCount = '5467 ' )
then essentially I need to do this
#set ...

14. Starting Apache Velocity Localization/Internationalization (i18n)    stackoverflow.com

I have a great difficulty finding documentation on how to implement internationalization/localization with Apache Velocity. I checked Velocity documentation and did online research, but I can't find supporting material on how ...

15. Adding folder to classpath in Velocity using Spring framework    stackoverflow.com

How can I add an entire folder to Velocity and use the files inside as resource bundles? Currently in my velocity.xml I have this code:

<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
    <property name="parentMessageSource">
 ...

16. How to Apache Velocity locale dynamically within Spring Framework?    stackoverflow.com

I'm using VelocityTools to implement localization of the Velocity templates within Spring. However I don't seem to understand how to change the default Velocity locale set in the toolbox.xml i.e. ...





17. Can Velocity ResourceTool object be made aware of the current request?    stackoverflow.com

I sub-classed ResourceTool.java and overrode one of the get() example:

public class MySubClassedResourceTool extends ResourceTool {

   @Override
   public Object get(String arg0, String[] arg1, Locale arg2) {
   ...

18. Configuring Velocity Tools with VelocityViewResolver    forum.springsource.org

Hi all, I'm in the middle of migrating our application to Spring MVC and got stuck on how to configure Velocity Tools with VelocityViewResolver. Is there an easy way to do ...

19. Velocity & JSTL    forum.springsource.org

When would one prefer to use velocity over JSTL? I'm working with spring which is quite neat, so of course I want a neat solution up the front. Any suggestions or ...

20. How to catch Velocity errors?    forum.springsource.org

Hello, While processing a template, if Velocity cannot resolve the view for a #include or #parse it throws a ResourceNotFoundException that cascades into a javax.servlet.ServletException. Is there any way to trap ...

21. GET parameters and Velocity context    forum.springsource.org

I am using a RedirectView from one page, supplying a name/value pair as the model as follows: Code: View redirect = new RedirectView(getSuccessView()); return new ModelAndView(redirect, "name", "value"); My Velocity template ...

22. Spring and velocity    forum.springsource.org

Spring and velocity Hi All I am new to Spring and trying to use it with velocity template engine. I have two vm(velocity templates) namely a.vm and b.vm. I am including ...

23. Displaying validation errors in Velocity templates...    forum.springsource.org

Displaying validation errors in Velocity templates... The BindException class allows you to reject either a specific field in the command object (using "rejectValue") or the entire command object (using "reject"). Is ...

24. error loading spring.vm (Velocity)    forum.springsource.org

error loading spring.vm (Velocity) I've been following the reference guide for integrating Velocity. http://www.springframework.org/docs/...#view-velocity When I start up the WAR, I get this warning: [java] INFO VelocityEngine:48 - Velocimacro : initialization ...

25. right way to use custom editors in non-form velocity pages.    forum.springsource.org

Hi, I want to format dates according to the current locale on Velocity pages that are created by a simple controller. Since there is no binding facility, how do I do ...

26. Exposing velocity context    forum.springsource.org

I am very happy with Springs out of the box support for alternative view technologies like Velocity and FreeMarker. We are using velocity for a part of our project. We have ...

27. Form validation errors with Velocity    forum.springsource.org

When an error occurs while adding a user I want to be able to show the same form the user filled in with the validation errors at the top of the ...

28. Trouble populating Velocity template    forum.springsource.org

Trouble populating Velocity template Hi, I'm using Spring 3.1 with Velocity 1.6.1. I have this code Code: /* * Build the template */ final String emailBody = VelocityEngineUtils.mergeTemplateIntoString(ve, template, map); in ...

29. Integrating Spring with Velocity    forum.springsource.org

Aug 7th, 2011, 07:38 PM #1 vbindal View Profile View Forum Posts Private Message Junior Member Join Date Aug 2011 Posts 4 Integrating Spring with Velocity I am trying to integrate ...

30. How do I use velocity support    forum.springsource.org

How do I use velocity support I am trying to use velocity support in spring in a standalone app. I have defined the velocity engine bean using Code: ...

31. Velocity templates need help    forum.springsource.org

Velocity templates need help Its somewhat disappointing that both WebWork and Spring which have out-of-box support for Velocity (which is great!) seem to treat Velocity like JSP (which is bad!) in ...

32. How to configure Velocity Tools for a VelocityEngine?    forum.springsource.org

Hi, It may be a simple question, but now I'm dealing with velocity-based emails. I've done the tutorial as Matt Raible discussed. I'd like to use the $format.number() velocity tool (results ...

33. Spring commons validator with velocity views    forum.springsource.org

Spring commons validator with velocity views have been using commons validator with spring for a few months and I have no complaints. Since spring does not provide any declarative validation features ...

34. Velocity: resourceLoaderPath    forum.springsource.org

Hello, I'm trying Velocity Spring support I have a question: I've set resourceLoaderPath with value /templates where templates is a directory under my web app root In this directory, and its ...

35. How to setup velocity    forum.springsource.org

Hi evrybody, I am very new programmer to spring framework, velocity and hybernate. Please suggest me how to setup and configure. Thanks in advance RA

36. How to configure Velocity tools?    forum.springsource.org

Hi. I'm in the process of porting a web app from Struts to Spring MVC. Our app uses Velocity to render views. In out old app, the Velocity templates contain references ...

37. How to use Velocity Tools in Spring    forum.springsource.org

How to use Velocity Tools in Spring Hi; I am using Spring1.1.3, have tried to configure velocity tools into the system. Could somebody tell me how to do it? I have ...

38. Trying to use Velocity and JSP side-by-side    forum.springsource.org

Trying to use Velocity and JSP side-by-side I am beginning a process of converting to Velocity for a Spring MVC application. Currently, all views are JSP/JSTL. I thought I could simply ...

39. Showing global errors with velocity and binding    forum.springsource.org

Showing global errors with velocity and binding Hi, I have this snippet of VTL in one of my templates, and it works fine, it shows the field-specific errors no problem. Name: ...

40. Developer needed for small (Spring/Velocity) web project    forum.springsource.org

Developer needed for small (Spring/Velocity) web project I apologize for posting something a little off-topic, but I'm not sure where else I can find people who can work in these technologies. ...

41. Velocity ResourceNotFoundException -> Want HTTP 404    forum.springsource.org

Velocity ResourceNotFoundException -> Want HTTP 404 I'm using spring velocity view support and currently, when someone gets a broken link, it generates the following errors and results in a HTTP 500 ...

42. $req with Velocity    forum.springsource.org

$req with Velocity Hi folks, We're using Velocity for templating with Spring MVC. I've seen elsewhere references to a $req model property being available - any attempt to use it doesn't ...

43. Small spring/velocity config problem    forum.springsource.org

Small spring/velocity config problem Hi there, I'm new to Spring and Velocity and having a config issue - I think that I may be missing some part of the configuration. If ...

44. Velocity Template Location    forum.springsource.org

Velocity Template Location Hello, I am getting a NullPointerException with VelocityEngineUtils. org.springframework.ui.velocity.VelocityEngineUtil s.mergeTemplate(VelocityEngineUtils.java:55) I am guessing it can't find the template. I am trying to merge a template so I can ...

45. URL encoding and generation with Velocity    forum.springsource.org

Hi All, Just wondering if there is a way anyone has that they would recommend for generating URLs in Velocity templates. At the moment, I'm just doing this: An ...

46. Using Long in velocity templates    forum.springsource.org

I know this is more of a velocity question, but has anyone figured out a good way to deal with Long objects in velocity templates? If you have the following velocity ...

47. problems with spring macros and velocity    forum.springsource.org

Hi all I'm a new spring user and have problems with the spring macros. Because I'm already worked with velocity, i decided to use it again. For a first example I ...

48. Using Tiles + Velocity    forum.springsource.org

Using Tiles + Velocity I am using spring-1.2-rc2, and I would like to use Spring MVC + tiles + velocity. I have been able to configure a tiles app, and a ...

49. Problem running SpringPortlet+Jetspeed2+Velocity    forum.springsource.org

Problem running SpringPortlet+Jetspeed2+Velocity Please help! I create a simple application to deploy to Jetspeed2 M3. For the Velocity view it is just: Code: #set($nodeLink = $renderResponse.createActionURL()) $nodeLink If all is OK, ...

50. Velocity - RHS of #set statement is null    forum.springsource.org

Velocity - RHS of #set statement is null Hello, I'm using the spring velocity macros in a page and they were working when I was using the ResourceBundleViewResolver but I needed ...

51. SOLVED: #springBind To a List (with Velocity)    forum.springsource.org

SOLVED: #springBind To a List (with Velocity) I need to create a form that will allow simultaneous editing of several domain objects (Payment objects). I have extended SimpleFormController, so that formBackingObject() ...

52. Velocity + Tiles, is it possible?    forum.springsource.org

Hello, I just started with the Spring Framework and I am trying to port a Struts application to Spring. In struts I was using Velocity and Tiles for all my templating ...

53. velocity view and mime-type    forum.springsource.org

Hi, I'm using the VelocityViewResolver to show some pages. What I want to do now is to change the mime-type of the resulting pages from within the controller. But it does ...

54. How to sto stop bind macro showing in Velocity template.    forum.springsource.org

How to sto stop bind macro showing in Velocity template. Just starting to use Spring MVC a little more. I can bind an input value using Velocity in a page that ...

55. Velocity and Classpath Mega-woes    forum.springsource.org

Velocity and Classpath Mega-woes 'lo all, I'm using velocity to render pages in the web tier using spring under jboss 4.0.1 deployed as a simple war file. Here is the velocity ...

56. #springUrl using Velocity    forum.springsource.org

Yes, but as it turned out, the view resolver wasn't being hit because I was using a VelocityLayoutView type view with explicit url refs to velocity template files within. All is ...

57. Tiles / Velocity / Others    forum.springsource.org

Hi, when i post messages about Tiles and never see any answer (made 5threads and one suggestion as answer) i'm asking myself if tiles is used or not, or if some ...

58. Localization in Spring using velocity    forum.springsource.org

Localization in Spring using velocity :twisted: :oops: :x :cry: :mrgreen: I am using velocity engine in Spring framework. I am developing a localized Web Application. So, for that i am using ...

59. Configuring Event Handlers For Velocity    forum.springsource.org

Configuring Event Handlers For Velocity I have some templates, that during the course of their rendering, can cause various exceptions. After looking at the Velocity Docs, it appears I can add ...

60. Spring Velocity Javascript can they work together    forum.springsource.org

Spring Velocity JavaScript can they work together? Im trying to make an internationalized js-message using following code from the .js file: Code: confirm('#springMessage("saveIfChanged@generic.translations")') where springMessage is a velocity macro: Code: #macro( ...

61. Tiles, JSTL and Velocity:How ?    forum.springsource.org

Tiles, JSTL and Velocity:How ? I'm using tiles+jstl and is working perfect, but now I want render in main page velocity templates (*.vm) is possible ? how ? When I use ...

62. Velocity tool box & VelocityEngine    forum.springsource.org

Velocity tool box & VelocityEngine Hi all, I'm trying to use a velocity template to send emails to clients after they've completed a booking. This works well when I use the ...

63. Velocity Templates, non-web    forum.springsource.org

Velocity Templates, non-web I want to use Spring's embedded Velocity template support to produce formatted e-mail messages. This is not a web app, so I loose all benefits of the extensive ...

64. How to configure Velocity Templates in multiple location using Spring    forum.springsource.org

How to configure Velocity Templates in multiple location using Spring Hi all, I have some Velocity Templates under \WEB-INF\templates directory and also have some velocity templates under some other directories such ...

65. Velocity and the VM_global_library.vm file    forum.springsource.org

66. Velocity, validation and showErrors    forum.springsource.org

Velocity, validation and showErrors Hi, My situation is like this: 1) I'm using a wizard controller 2) I am going to validate all the fields on the last page 3) I ...

67. problem with velocity config    forum.springsource.org

problem with velocity config Hi, I am trying to switch my app from jsp to velocity, but I'm having trouble getting set up. This works:

68. bind multiple checkboes with velocity    forum.springsource.org

bind multiple checkboes with velocity Hi all, I want to bind multiple check boxes with velocity. I have written following code: #springBind("questionInfoTO.questionDetails[$count].options") #set($options = $status.value) #foreach($optionObj in $options) #set( $index = ...

69. spring velocity macros in included velocity templates?    forum.springsource.org

spring velocity macros in included velocity templates? I'm using Velocity with Spring, and everything was working fine until I tried to use #springMessage() in an included .vm, and it does not ...

70. How to configure Velocity Tools in Spring    forum.springsource.org

How to configure Velocity Tools in Spring This is my code to use velocity It's use Spring VelocityConfigurer Bean Code: Properties p = new Properties(); String path = Constant.ROOTPATH + Constant.VMFILE; ...

71. Generate ms-word documents using Velocity    forum.springsource.org

Generate ms-word documents using Velocity In a Spring Controller Im using Velocity to generate ms-word documents. I have a rtf template containing both header/footer, fixed texts and of course velocity tags ...

72. Velocity tools in VelocityEngine    forum.springsource.org

Hello, I'm using VelocityEngine to send html emails like described in this article: http://www.theserverside.com/blogs/s...gVelocityEmail I have to format numbers and dates in email's text but I don't know how to configure ...

73. Nested Bind Path for velocity    forum.springsource.org

i am using velocity. can anyone let me know how can we specify nested binding in velocity. i tried #springBind("emp.dept.id") but didn work Thanks, sprnew

74. how to unittest velocity templates with toolbox and macro enabled    forum.springsource.org

I am looking for a way to unit test, meaning not testing without starting a web server, velocity templates. I understand that the toolbox and macros are tied with servlets, but ...

75. Any performance advantage on Velocity over JSP?    forum.springsource.org

76. Velocity AbstractSearchTool Spring-aware    forum.springsource.org

Hi, is it possible to make the AbstractSearchTool spring-aware? I need to put an dao Object in my searchToolImpl to execute a query against the database. Do i have to set ...

77. Problems during initializing of Velocity    forum.springsource.org

org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'velocityConfig' defined in ServletContext resource [/WEB-INF/servlets-servlet.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/collections/ExtendedProperties

78. Velocity & Portlet & Pluto 1.0.1    forum.springsource.org

Velocity & Portlet & Pluto 1.0.1 This code (applicationContext.xml) working correctly: Code: ?xml version="1.0" encoding="UTF-8"?>

79. Velocity in portlets: what is the equivalent of ?    forum.springsource.org

Velocity in portlets: what is the equivalent of ? I'm very new to portlets, JSP, Spring, Velocity, the whole web-thing. I'm trying to develop some portlets for Liferay and I'm ...

80. Tiles, Velocity    forum.springsource.org

Hi, I've seen this question come up of how to use Tiles with Velocity, and remains unanswered. It's really unfortunate that the built-in tiles support is basically JSP specific, but such ...

81. velocity macro with spring    forum.springsource.org

velocity macro with spring Hi all, I am using spring with velocity. But not be able to get macro to work properly. When the application started, the log message states that ...

82. velocity request param    forum.springsource.org

Hi, i have the following url: Code: http://localhost:8080/sistemaExpedientes/app/nuevaUnidadExito?unidadCreadaNombre=FIUBA&unidadCreadaEmail=FIUBA@gmail.com ..in the controller.. model.put("unidadCreadaNombre",uc.getNombre()); model.put("unidadCreadaEmail",uc.getEmail()); return new ModelAndView(getSuccessView(),model); How can i read the parameters in a velocity file? $unidadCreadaNombre doesn't work $param.unidadCreadaNombre doesn't ...

83. Dynamic Velocity resourceLoaderPath?    forum.springsource.org

Dynamic Velocity resourceLoaderPath? I have a client that wants to be able to display a totally different set of Velocity templates based on the Domain a user enters a web app. ...

84. Ajax and Velocity using Springmodules    forum.springsource.org

Ajax and Velocity using Springmodules Hello there, I am using springmodules in order to use ajax in an easier way, I am also using velocity so I have no jsp buy ...

85. problem in referencing stylesheet for velocity app    forum.springsource.org

hi all, i have developed a SpringMVC application that uses velocity layout of my app is as follows Code: webapp css |__ agencies.css WEB-INF\velocity |__layout |__ default.vm template.vm i am trying ...

86. single checkbox and velocity macro ?    forum.springsource.org

Hi all, I have a boolean value ('stacked') which I want to set with a checkbox. I wrote the following code : Code: #springBind("command.stacked")

87. Has anyone managed to use NullTool with Velocity using SPring?    forum.springsource.org

Has anyone managed to use NullTool with Velocity using SPring? I configured NullTool as so: iteratorTool ...

88. Springframework and Velocity    forum.springsource.org

Will we still gain any advantage from Apache Velocity when we have used Springframework MVC? What's the advantage of the template over JSP? Thanks.

89. Forms in velocity problems    forum.springsource.org

Forms in velocity problems I use Velocity as view in my project. And now I need to generate a form related to the Order bean. I can generate a form using ...

90. Velocity Template Merging Issue    forum.springsource.org

Velocity Template Merging Issue We have a project requirement wherein we have to pick predefined (Velocity) mail templates, and populate data. A composed mail would look like: SrNo Col1 Col2 ... ...

91. Velocity with AJAX    forum.springsource.org

Velocity with AJAX I am trying to use velocity to load a template. This template will be called from js via AJAX. I am getting the following exception: org.springframework.context.ApplicationContextExce ption: Cannot ...

92. Velocity 1.5 and LogChute    forum.springsource.org

Has anyone tried to use the newest version of velocity? I get the message: "LogSystem has been deprecated. Please use a LogChute implementation." I see this comes from the VelocityEngineFactory setting ...

93. Pagination using Spring and Velocity    forum.springsource.org

94. spring velocity configuration!    forum.springsource.org

spring velocity configuration! have issues with spring velocity configuraiton. ********************************* added in spring-servlet.xml file of my project ********************************* WEB-INF/views /WEB-INF/velocity.properties ...

95. Spring velocity form reload issue!!!!!    forum.springsource.org

Spring velocity form reload issue!!!!! what i m trying to do, spring displays a form, when click on submit it should display the same form but added attribute value in request ...

96. reborn- Spring velocity form reload issue!!!!!    forum.springsource.org

reborn- Spring velocity form reload issue!!!!! what i m trying to do, spring displays a form, when click on submit it should display the same form but added attribute value in ...

97. Spring Velocity Help..    forum.springsource.org

Spring Velocity Help.. hi guys, i have a problem on my Spring-Velocity code: im getting this error; ResourceManager : unable to find resource 'C:\Documents and Settings\jason\workspace\PPCC-Survey\WebContent\WEB-INF\email.vm' in any resource loader. org.springframework.mail.MailPreparationException: ...

98. spring velocity macro List-Checkbox    forum.springsource.org

spring velocity macro List-Checkbox I have a situation when a user selects an option from List,checkboxes should be displayed based on that list option.I am not able to figure out how ...

99. Velocity and jsp together in spring    forum.springsource.org

Velocity and jsp together in spring Hi, I came across a problem while using velocity and jsp together with spring. I want to use both .jsp and .vm files for view. ...

100. #springMessage in velocity    forum.springsource.org

#springMessage in velocity Hi, I am using #springMessage in velocity template for getting message values from message resource bundle. in xxx-sevlet.xml i configured like this. ...