首页 \ 问答 \ Spring Boot 1.4 VelocityEngineUtils已弃用(Spring Boot 1.4 VelocityEngineUtils deprecated)

Spring Boot 1.4 VelocityEngineUtils已弃用(Spring Boot 1.4 VelocityEngineUtils deprecated)

我刚刚更新到spring boot 1.4并注意到VelocityEngineUtils已被弃用。 我正在使用Velocity模板发送与spring框架示例相同的电子邮件

发送除Velocity模板以外的电子邮件模板的替代方法是什么


i just updated to spring boot 1.4 and noticed that VelocityEngineUtils is deprecated. I am using Velocity Templates to send emails same as in spring framework example

What are the alternative for sending emails templates other than Velocity template


原文:https://stackoverflow.com/questions/38651915
更新时间:2022-04-07 20:04

最满意答案

您的代码构造方式只会在页面加载时运行一次 - 在这种情况下,select的值将始终为空字符串。 如果您希望它响应更改:

$("#analyses").bind("change",function(){

    if (document.getElementById("analyses").value == 'distance'){

        loadScript('/static/distance.js', function()
        {
           console.log('done loading');
        });
    }else{
        loadScript('/static/geoClusters.js', function()
        {   
            console.log('done loading');
        });
     }
});

The way your code is structured it will only run once on page load - in which case the value of the select will always be an empty string. If you want it to respond to changes:

$("#analyses").bind("change",function(){

    if (document.getElementById("analyses").value == 'distance'){

        loadScript('/static/distance.js', function()
        {
           console.log('done loading');
        });
    }else{
        loadScript('/static/geoClusters.js', function()
        {   
            console.log('done loading');
        });
     }
});

相关问答

更多
  • return语句结束一个函数,你不能在它后面执行代码。 你可以这样做: ret = "You are logged out."; Logout(); return ret; The return statement ends a function, you cannot execute code after it. You could do this: ret = "You are logged out."; Logout(); return ret;
  • 我们来分析你的代码: if(i % size === 0) 这意味着,当i等于0或是大小的倍数时。 在你的情况下,大小是8。 所以对于你的触发器,我应该是0,8,16,32 .... 在所有这些情况下,它永远不会触发,因为当我是0,8,16,32 ... i%2是0时,所以它将运行第一个if而不是第二个。 您应该反转ifs的顺序或运行两者 Let´s analyse your code: if(i % size === 0) This means, when i is equal to 0 or i ...
  • 是的,你可以,GPU风格。 假设您有一个分支的函数,并在最后返回一个值。 float function( float input ) { if( input > 0 ) { // do stuff finalValue = 2+4+8*input; return finalValue ; } else { // do other stuff finalValue = 1+input; ...
  • 您的代码构造方式只会在页面加载时运行一次 - 在这种情况下,select的值将始终为空字符串。 如果您希望它响应更改: $("#analyses").bind("change",function(){ if (document.getElementById("analyses").value == 'distance'){ loadScript('/static/distance.js', function() { console.log(' ...
  • 听起来您正在寻找逻辑异或(XOR)操作。 这里有一些Javascript示例。 我最喜欢的(出乎意料和简单)是: if (foo ? !bar : bar) { ... } 不可否认,这是一个不寻常的编码,并且接近“过于聪明”。 有时,如果一种语言没有操作的直接语法,则代码必须是冗长的,比如从除法运算中获取商和余数。 It sounds like you are looking for a logical exclusive-or (XOR) operation. There are some J ...
  • 你可能希望它更像是: var uname = document.getElementById("pword1").value; var pword = document.getElementById("cPassword").value; var passReq = "^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[\\\+\=\"\.\[\]_£|`¬':;~{}<>()#?!@$%^&*-]).{8,20}$"; var pwReqExp ...
  • 您不应该在click函数中重新定义resizeValue变量。 只需从var resizeValue删除var (它只应在var resizeValue的顶部使用)。 You shouldn't redefine the resizeValue variable within the click function. Just remove var from var resizeValue (it should only be used at the top of the ready-function).
  • 尝试这个: var myApp = angular.module('myApp',[]); function MyCtrl($scope) { var items = [ { "Item 1": "sub 30" }, { "Item 2": "sub 53" }, { "Item 7": "sub 21", ...
  • create table table1(tem varchar2(50), tablename varchar2(50)); create table tabl2(tabl_name varchar2(50)); insert into table1(tem, tablename) values ('table1','table1'); begin for rc in (select tablename from table1) loop --dbms_output.put_line('i ...
  • 请参见async.whilst 。 你需要for循环的流控制,为此它提供了一个回调来控制每个循环迭代。 var temphtml = "", j = 0; async.whilst( function() { return j < 3 }, function(callback) { db.austinsroom.find({"y": j }, {}).sort({"x": 1}, function(err, records) temphtml += records.m ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。