我有这个错误启动我的spring应用程序:
java -jar target/gs-serving-web-content-0.1.0.jar
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v0.5.0.M6)
2013-12-23 00:23:09.466 INFO 19252 --- [ main] hello.Application : Starting Application …Run Code Online (Sandbox Code Playgroud) 我试图使用node.js的套接字,我成功但我不知道如何区分我的代码中的客户端.关于套接字的部分是这样的:
var WebSocketServer = require('ws').Server,
wss = new WebSocketServer({port: 8080});
wss.on('connection', function(ws) {
ws.on('message', function(message) {
console.log('received: %s', message);
ws.send(message);
});
ws.send('something');
});
Run Code Online (Sandbox Code Playgroud)
这段代码适用于我的客户端js.
但我想向特定用户或在我的服务器上打开套接字的所有用户发送消息.
在我的情况下,我作为客户端发送消息,我收到响应,但其他用户没有显示任何内容.
我想例如user1通过webSocket向服务器发送消息,并向打开套接字的用户2发送通知.
我有以下ReactJS类:
import React from 'react'
export class Content extends React.Component {
static getValue(key) {
return key
}
render() {
let value = this.getValue(this.props.valueKey);
return <span dangerouslySetInnerHTML={{__html: value}} />
}
}
Run Code Online (Sandbox Code Playgroud)
但是我有以下错误:
TypeError: this.getValue is not a function
Run Code Online (Sandbox Code Playgroud)
我不明白.这是调用静态函数的好方法吗?我认为反应是用静电做的,但我不知道是什么.
我有一个ID数组,我想从我的ID数组中获取一个实体数组.
我不能用find.
sql请求如下所示:
SELECT * FROM mytable WHERE id = 12 OR id = 10 ...
Run Code Online (Sandbox Code Playgroud)
我的id数组上有一个循环.
我正在尝试创建一个spring mvc应用程序.这是我的pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>test</artifactId>
<name>springmvc</name>
<packaging>jar</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<org.springframework-version>3.1.1.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
</properties>
<repositories>
<repository>
<id>spring-milestone</id>
<url>http://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-milestone</id>
<url>http://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency> …Run Code Online (Sandbox Code Playgroud) 我有一个带有php应用程序的docker
例如,我有一个分享量
/home/me/dev/site <=> /var/www/site
Run Code Online (Sandbox Code Playgroud)
我可以在我的主机上写一些东西,它会与容器同步
如果我发射
sudo docker exec test touch /var/www/site/test.txt
Run Code Online (Sandbox Code Playgroud)
有用
但是,如果我的服务器正在尝试创建一个文件,因为www-data这是因为权限不起作用.
有没有办法让我的共享卷访问www-data?
我正在使用boot2docker
我正在尝试在Symfony2中实现websockets,
我发现这个http://socketo.me/看起来很不错.
我尝试使用Symfony它可以工作,这只是一个使用telnet的简单调用.但我不知道如何在Symfony中集成它.
我想我必须创建一个服务,但我不知道哪种服务以及如何从客户端调用它
谢谢你的帮助.
我在使用ansible在流氓ubuntu上安装MySQL时遇到问题,
这是我的MySQL部分
---
- name: Install MySQL
apt:
name: "{{ item }}"
with_items:
- python-mysqldb
- mysql-server
- name: copy .my.cnf file with root password credentials
template:
src: templates/root/.my.cnf
dest: ~/.my.cnf
owner: root
mode: 0600
- name: Start the MySQL service
service:
name: mysql
state: started
enabled: true
# 'localhost' needs to be the last item for idempotency, see
# http://ansible.cc/docs/modules.html#mysql-user
- name: update mysql root password for all root accounts
mysql_user:
name: root
host: "{{ item }}"
password: "{{ …Run Code Online (Sandbox Code Playgroud) 我正在尝试测试正在使用的服务 $http
var APIClient = function($http) {
this.send = function(data) {
$http({
method: data.method,
url: data.url,
headers: data.headers,
data: data.data
}).success(function(response, status) {
data.success(response, status);
}).error(function(response, status) {
data.error(response, status);
});
}
}
angular.module('api.client', []).factory('APIClient', ['$http'
function($http) {
var client = new APIClient($http);
return {
send: function(data) {
return client.send(data);
},
}
}
]);
Run Code Online (Sandbox Code Playgroud)
而且测试
describe('send', function() {
var apiClient, $httpBackend;
beforeEach(module('compare'));
beforeEach(inject(function($injector) {
$httpBackend = $injector.get('$httpBackend');
apiClient = $injector.get('APIClient');
}));
it('Should check if send() exists', function() {
expect(apiClient.send).toBeDefined();
}); …Run Code Online (Sandbox Code Playgroud) 我有一个这样的对象
objs:
- { key1: value1, key2: [value2, value3] }
- { key1: value4, key2: [value5, value6] }
Run Code Online (Sandbox Code Playgroud)
我想创建以下文件
value1/value2
value1/value3
value4/value5
value4/value6
Run Code Online (Sandbox Code Playgroud)
但我不知道如何使用双循环 with_items
ansible ×2
java ×2
javascript ×2
maven ×2
spring ×2
symfony ×2
websocket ×2
angularjs ×1
docker ×1
doctrine-orm ×1
ecmascript-6 ×1
mysql ×1
node.js ×1
php ×1
reactjs ×1
spring-mvc ×1
tomcat ×1
ubuntu ×1
vagrant ×1