小编fly*_*ish的帖子

如何将参数传递给主干牵线木偶复合视图模板

有没有办法将参数输入到牵线木偶复合视图模板中?我认为我初始化视图的任何参数都可以在模板中使用,但它似乎不起作用.

Views.myView = Marionette.CompositeView.extend({
  template: '#myView',
  otherstuff...
});


var collection = new App.Collection(); 
App.main.show(new Views.myView({
  collection: collection,
  isMine: true
}));
Run Code Online (Sandbox Code Playgroud)

模板:

<%= isMine %> 
Run Code Online (Sandbox Code Playgroud)

当渲染模板时isMine未定义:

backbone.js marionette

12
推荐指数
2
解决办法
1万
查看次数

Spring Bean自动装配错误

我正在尝试在我的应用程序中实现电子邮件功能,但我一直在努力

No matching bean of type [org.springframework.mail.javamail.JavaMailSenderImpl] found for dependency:  expected at least 1 bean which qualifies as autowire candidate for this dependency.
Run Code Online (Sandbox Code Playgroud)

谁能指出我做错了什么?

bean的xml配置是:

<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"   
xsi:schemaLocation="
    http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

<!-- Enables the Spring MVC @Controller programming model -->
<annotation-driven />
<context:annotation-config/>
//...other stuff

<beans:bean id="mailSession" class="org.springframework.jndi.JndiObjectFactoryBean">
    <beans:property name="jndiName" value="EmailServer" />
</beans:bean>

<beans:bean id="emailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
    <beans:property name="session" ref="mailSession"/>
</beans:bean>
Run Code Online (Sandbox Code Playgroud)

EmailServiceImpl类:

@Service
public class EmailServiceImpl implements EmailService {

    @Autowired
    private JavaMailSenderImpl emailSender; 

    //more code..
}
Run Code Online (Sandbox Code Playgroud)

project_structure

java spring autowired

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

autowired ×1

backbone.js ×1

java ×1

marionette ×1

spring ×1