Get parameters from velocity template
I have such problem. I'm writing integration tests for my app. In the app I send some mails for the users. When I create email I use Velocity templates. Example of template:
Hi ${user}!
Example of mail:
Hi User!
When I write my integration tests I want to parse parameters from received emails. If I have velocity template and mail which was created with using of this template. I want such method
Map<String,String> getParameters(velocityTemplate, mailBody);
How I can parse parameters from emails text?
If your question is like Velocity (VM) template request parameters: Getting GET variables then the answer is:
$httpUtil.getParameterMap($httpUtil.getQueryString($request.attributes.CURRENT_URL))
or, as it turns out:
$request.getParameterMap($request.getQueryString($request.attributes.CURRENT_URL))
链接地址: http://www.djcxy.com/p/47314.html
上一篇: Android Opengl ES:导致GL的GLUtils.glTexImage2D
下一篇: 从速度模板获取参数