velocity

Problem with subject encoding when sending an email

橙三吉。 提交于 2019-12-20 10:23:29
问题 I'm sending an email and I'm receiving it correctly but the encoding of the subject is not correct. I'm sending "invitación" but I'm receiving "invitaci?n". The content of the message is OK. The content of the message is coming from a transformation of a Velocity Template while the subject is set in a String variable. I've googled around and I've seen that some people says that MimeUtility.encodeText() could solve the problem, but I have had no success with it. How can I solve the problem?

velocity null point exception

允我心安 提交于 2019-12-20 05:09:16
问题 I want to send mail using velocity templates. My configuration based on Spring 3.1 documentation. I have an xml file with configuration: <?xml version="1.0" encoding="UTF-8"?> http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"> <bean id="sendMail" class="com.myclass.app.SendMail"> <property name="mailSender" ref="mailSender"/> <property name="velocityEngine" ref="velocityEngine"/> </bean> <bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean

How do I pass get request parameters to my Velocity Template to send mails

匆匆过客 提交于 2019-12-20 03:24:12
问题 I have a JSP and in that JSP I have a link which looks something like http://mydomain.com/verify.do?email=emailid&id=123 Now when users clicks that link, it goes to my velocityview servlet, now my question is how do I pull out those parameters in velocity servlet and put it into the context so that I can send it to my template. I tried getparameter,#set(#request.getAttribute(email) etc.But for some reason I dont see the value getting into the context or template. I know there is velocity

How do I pass get request parameters to my Velocity Template to send mails

最后都变了- 提交于 2019-12-20 03:24:02
问题 I have a JSP and in that JSP I have a link which looks something like http://mydomain.com/verify.do?email=emailid&id=123 Now when users clicks that link, it goes to my velocityview servlet, now my question is how do I pull out those parameters in velocity servlet and put it into the context so that I can send it to my template. I tried getparameter,#set(#request.getAttribute(email) etc.But for some reason I dont see the value getting into the context or template. I know there is velocity

subtraction is not working with velocity template

我们两清 提交于 2019-12-20 02:39:09
问题 I have this code in velocity html <html> #set ($Total1 = 0.0) #set ($Total2 = 3.0) #set ($Total3 = $Total2 -$Total1) $Total3 </html> The $Total3 is not getting displayed. In fact the subtraction is not working. Can anyone please help me on this 回答1: I just tried that example in Velocity 1.6 and it worked fine. Two possible things that might be causing problems. (1) Your example is not copied correctly. If a dash is next to an identifier, it becomes part of the identifier. So this example

Struts2 - How can I get the result of a JSP page as a string in an action class (for emails)

帅比萌擦擦* 提交于 2019-12-20 02:37:11
问题 I want to achieve the 2 things at the same time. I have a regular jsp page in Struts2. xx/yy/zz/email.jsp <html> <head> </head> <body> <s:property value="email"/> </body> </html> The url of this page could be xx/yy/zz/myEmail.action, while some action class will handle it... public class MyEmailAction { private String email; public String execute(){ this.email = 'abc@xyz.com'' } //setter and getter for 'email' ...... } Now, I would like to have another action, which sends the result of the

Atlassian JIRA Plugin Development: How to make variables available to velocity templates

Deadly 提交于 2019-12-19 14:37:23
问题 FAIR WARNING: this question is going to be pretty tough to answer unless you have experience with JIRA and have access to their source (enterprise users). Greetings all, I am writing a plugin which extends AbstractIssueSelectAction. I noticed that ${issue.summary} , etc are all available from within my velocity template, however, there are other things I wish to expose. I can't figure out how to add other things to the velocity parameter map. I even used a remote debugger to try to step

How to turn off Velocity unit testing in Meteor? [duplicate]

放肆的年华 提交于 2019-12-19 09:26:31
问题 This question already has answers here : Temporarily disable Meteor testing packages (e.g. Velocity + Mocha) without removing them (3 answers) Closed 4 years ago . I'm using the mike:mocha package and I'm trying to figure out how to disable testing. There are times when I have to demo the app I'm working on in my local machine. For those situations, I would like to run the application without the green dot on the top right. 回答1: After some googling I found that running meteor --production run

Velocity Template - regular expressions

丶灬走出姿态 提交于 2019-12-19 04:50:17
问题 I just started using velocity for a new job and I really don't like what I have found already. At this point, i would actually prefer freemarker =X. Anyways, i'm trying to do a regular expression and i saw this little bit (search "regular expression"), but that isn't quite the implementation I am doing. I do not have any access to the java so that option of writing something custom to do this stuff is not there (i'm not even sure if that is possible). This is what i have right now: #set (

How to get a zero-based count in a Velocity foreach loop

你。 提交于 2019-12-18 18:54:22
问题 I am trying to get a zero-based counter in a Velocity #foreach directive. if i use: #foreach ($item in $list) item.getName() : $velocityCount #end i will get: Fred : 1 Wilma : 2 Barney : 3 But i need: Fred : 0 Wilma : 1 Barney : 2 The solution must be as simple as possible from the velocity template's point of view. EDIT : I can use: #foreach ($item in $list) #set( $num = $velocityCount - 1 ) //The white space in mandatory item.getName() : $num #end and it works. But I'm looking for a more