我正在网站上使用facebook登录,以方便用户登录或注册,但我刚刚意识到,如果我登录到Facebook,则登录按钮不会显示.如果我退出,它会显示预期的方式.
以前它曾经工作过,也许是2个月之前,但它现在不起作用.
fb:login标签的用法如下:
<fb:login-button onlogin="myJScript();" />
Run Code Online (Sandbox Code Playgroud)
...
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '#{serviceBean.FACEBOOK_API_KEY}', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
Run Code Online (Sandbox Code Playgroud)
没什么特别的......
这个fb:login的使用有什么变化吗?
我在我的应用程序中使用 SpringBoot,并且目前正在使用applicationContext.getBean(beanName,beanClass)它在对它执行操作之前获取我的 bean。我在几个问题中看到不鼓励使用getBean(). 由于我对 Spring 非常陌生,因此我不了解所有最佳实践并且很矛盾。上述链接问题中提出的解决方案可能不适用于我的用例。我应该如何处理这个问题?
@RestController
@RequestMapping("/api")
public class APIHandler {
@Value("${fromConfig}")
String fromConfig;
private ApplicationContext applicationContext;
public Bot(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
@PostMapping(value = "")
public ResponseEntity post(@RequestBody HandlingClass requestBody) {
SomeInterface someInterface = applicationContext.getBean(fromConfig, SomeInterface.class);
someInterface.doSomething();
}
}
Run Code Online (Sandbox Code Playgroud)
我有一个名为SomeInterface定义的接口,如下所示:
public interface SomeInterface {
void doSomething();
}
Run Code Online (Sandbox Code Playgroud)
我有 2 个类实现了这个接口,称为UseClass1和UseClass2。我的配置文件存储了一个带有类的 bean 名称的字符串,我需要在运行时知道它并调用该方法的适当实现。
任何方向将不胜感激。
我有一个类似于这样的表:
CREATE TABLE message(id int, type varchar(100), created timestamp);
insert into message (id, type, created) values (1, 'hello', '2014-04-16');
insert into message (id, type, created) values (2, 'hello', '2014-04-16');
insert into message (id, type, created) values (3, 'login', '2014-04-16');
insert into message (id, type, created) values (4, 'login', '2014-04-16');
insert into message (id, type, created) values (5, 'hello', '2014-04-17');
insert into message (id, type, created) values (6, 'hello', '2014-04-17');
insert into message (id, type, created) values (7, 'login', '2014-04-17');
insert …Run Code Online (Sandbox Code Playgroud)