小编Mer*_*cer的帖子

如何在另一个目录中解压缩tar.gz

我有一个档案

与*.tar.gz

如何在目标目录中解压缩?

unix gzip tar

258
推荐指数
2
解决办法
26万
查看次数

如何从列表中删除重复项?

我想从列表中删除重复项,但我正在做的是不起作用:

List<Customer> listCustomer = new ArrayList<Customer>();    
for (Customer customer: tmpListCustomer)
{
  if (!listCustomer.contains(customer)) 
  {
    listCustomer.add(customer);
  }
 }
Run Code Online (Sandbox Code Playgroud)

java collections list duplicates

55
推荐指数
8
解决办法
15万
查看次数

如何对Collection <T>进行排序?

我有一个通用的Collection,我试图找出如何排序其中包含的项目.我尝试了一些东西,但我不能让它们中的任何一个工作.

java sorting collections

51
推荐指数
5
解决办法
11万
查看次数

将集合转换为列表

我想问:你如何转换CollectionListJava中?

java collections

46
推荐指数
3
解决办法
9万
查看次数

如何将两个日期值与jQuery进行比较

我有两个字符串字段代表我的页面中的日期,我想比较这两个字段,以了解我的第一个日期<第二个日期.我怎样才能做到这一点?

<tr>
    <td align="right">First Date: </td>
    <td align="left"> <html:text name="addPublicationForm" styleId="firstDate" property="firstDate" maxlength="10"/></td>
</tr>
<tr>
    <td align="right">Second Date: </td>
    <td align="left"> <html:text name="addPublicationForm" styleId="secondDate" property="secondDate" maxlength="10"/></td>
</tr>
Run Code Online (Sandbox Code Playgroud)

jquery compare date

39
推荐指数
4
解决办法
20万
查看次数

将列表强制转换为集合

我有一些pb.我想在java中将List转换为Collection

Collection<T> collection = new Collection<T>(mylList); 
Run Code Online (Sandbox Code Playgroud)

但我有这个错误

无法实例化类型Collection

java collections list

25
推荐指数
2
解决办法
9万
查看次数

TinyMCE隐藏栏

我使用tinymce,我想隐藏按钮工具栏.有没有办法做到这一点?

tinymce

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

Mongoimport json文件更新或覆盖..?

我有DB的名称是"Project"和集合名称是"sample"然后我使用mongoimport命令插入一个JSON文件.

现在我编辑了相同的JSON文件.因此,如果要将相同的JSON文件导入到Collection,那么我就会遇到问题,例如创建了多个实例并且没有进行更新.

有没有办法更新或覆盖mongodb使用mongoimport命令中已存在的数据?

请注意,我也尝试过使用--mode=upsertflag:

./mongoimport --db Project --collection sample --mode=upsert --file   /home/rule.json
Run Code Online (Sandbox Code Playgroud)

json mongodb mongoimport

12
推荐指数
3
解决办法
8220
查看次数

Maven过滤不选择好的文件

我的项目结构:

- src
    - main
    - java
    - resources
    |   -hibernate.cfg.xml
    |   -log4j.properties
    - config
    |   -dev
    |   |   -hibernate.cfg.xml
    |   |   -log4j.properties
Run Code Online (Sandbox Code Playgroud)

我用maven-war-pluginmaven过滤.

pom.xml中:

<profiles>
    <profile>
        <id>dev</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>
        <properties>
            <profileVersion>DEV</profileVersion>
            <filterFile>src/main/filters/filter-dev.properties</filterFile>
            <configFolder>src/main/config/dev/</configFolder>
        </properties>
    </profile>
</profiles>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.6</version>
    <configuration>
        <filters>
            <filter>src/main/filters/filter.properties</filter>
            <filter>${filterFile}</filter>
        </filters>
        <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
        <webResources>
            <resource>
                <directory>${configFolder}</directory>
                <includes>
                    <include>log4j.properties</include>
                    <include>hibernate.cfg.xml</include>
                </includes>
                <targetPath>/WEB-INF/classes/</targetPath>
            </resource>
        </webResources>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
    <executions>
        <execution>
            <id>default-war</id>
            <phase>none</phase>
            <goals>
                <goal>war</goal>
            </goals>
        </execution>
        <execution>
            <id>package-war</id>
            <phase>package</phase>
            <goals>
                <goal>war</goal>
            </goals>
        </execution>
    </executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)

输出控制台: …

java maven

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

如何在Spring Boot中使用JWT身份验证实现基本身份验证?

我已经构建了一个Spring-Boot使用jwt身份验证的应用程序.

<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.diplie</groupId>
    <artifactId>rest-api</artifactId>
    <version>1.0.0</version>
    <packaging>war</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.0.RC1</version>
    </parent>

    <properties>
        <springfox-version>2.2.2</springfox-version>
        <java.version>1.8</java.version>
        <maven.test.skip>true</maven.test.skip>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt</artifactId>
            <version>LATEST</version>
        </dependency>

        <!-- Swagger 2 -->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${springfox-version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${springfox-version}</version>
        </dependency>
    </dependencies>

    <dependencyManagement> …
Run Code Online (Sandbox Code Playgroud)

java spring-security basic-authentication jwt spring-boot

11
推荐指数
1
解决办法
2236
查看次数