小编E2r*_*abi的帖子

Spring Boot中的@ComponentScan和@EnableAutoConfiguration有什么区别?

Spring Boot中的注释@ComponentScan@EnableAutoConfiguration注释有什么区别?是否有必要添加这些?没有这些注释,我的应用程序工作得很好.我只想了解为什么要添加它们.

java spring spring-mvc spring-boot

54
推荐指数
3
解决办法
4万
查看次数

泄漏期对于sonarQube意味着什么

我是SonarQube的新手,我开始阅读文档,但很多时候发现"泄漏期",但我没有发现任何关于它的事情,有人可以解释一下这意味着我的第二个问题是什么是声纳 - 跑步者的作用?我发现它很多时候我正在搜索声纳安装,即使我已经安装了sonarQube并将其与我的项目联系使用maven-sonar插件和eclipse插件sonarLint谢谢你

java sonar-runner sonarqube

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

这是否可以安装node-sass脱机代理

我正在尝试使用npm安装node-sass模块但每次显示有关网络配置中的问题的错误,因为我使用代理和私有注册表这是错误:

This is most likely not a problem with node-gyp or the package itself and is related to network connectivity In most cases you are behind a proxy or have bad network setting 
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

是否可以离线安装此模块?

sass node.js npm angularjs node-sass

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

我如何创建 Angular 自定义日期管道

我正在处理 angular 5 我想创建一个自定义日期管道,允许我从日期中减去一些天数:

这是我显示日期值的方式:

 <span>{{data.nextCertificateUpdate | date:'yyyy-MM-dd'}}</span>  
Run Code Online (Sandbox Code Playgroud)

例如,这显示一个值,如:2018-08-29

我问是否可以创建一个管道,允许我从这个日期减去天数,例如 28 天?

就像是 :

<span>{{data.nextCertificateUpdate | mypipe:28 }}</span>  
Run Code Online (Sandbox Code Playgroud)

这应该显示如下值:2018-08-01

谢谢你的帮助

javascript angular angular5

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

spring父上下文和子上下文之间有什么区别?

我正在阅读spring doc核心容器我希望在注入协作者时了解ref parent的目的然后我发现了父上下文子上下文或父容器和当前容器的概念这是我对它感到困惑的部分: 这部分博士

通过parent属性指定目标bean会创建对当前容器的父容器中的bean的引用.parent属性的值可以与目标bean的id属性相同,也可以与目标bean的name属性中的一个值相同,并且目标bean必须位于当前bean的父容器中.您主要在拥有容器层次结构并且希望将现有bean包装在父容器中并使用与父bean具有相同名称的代理时使用此bean引用变体.

<!-- in the parent context -->
<bean id="accountService" class="com.foo.SimpleAccountService">
    <!-- insert dependencies as required as here -->
</bean>
<!-- in the child (descendant) context -->
<bean id="accountService" <!-- bean name is the same as the parent bean -->
    class="org.springframework.aop.framework.ProxyFactoryBean">
    <property name="target">
        <ref parent="accountService"/> <!-- notice how we refer to the parent bean -->
    </property>
    <!-- insert other configuration and dependencies as required here -->
</bean>
Run Code Online (Sandbox Code Playgroud)

有人可以给我一些帮助或这两种情境的例子吗?以及ref父母的目的是什么 ,请提前谢谢

java spring spring-mvc

7
推荐指数
1
解决办法
7620
查看次数

Swagger 未检测到使用 Spring Data Rest 构建的 Api

我正在开发一个 Spring Boot 应用程序,使用 swagger 为我的 API 生成文档,我正在使用 Spring data rest 生成 Api,但是当我运行该应用程序时,我收到 swagger 消息:规范中没有定义操作!

这是我的 API 代码:

@Api(tags = "projets")
@RepositoryRestResource(collectionResourceRel = "projets", path = "projets")
public interface IProjectRepository extends JpaRepository<Project, Long> {

}
Run Code Online (Sandbox Code Playgroud)

这是我的配置文件:

@Configuration
@EnableSwagger2
public class QfactoryConfiguration {

    @Bean
     public Docket getDocketInstance() {
         return new Docket(DocumentationType.SWAGGER_2) 
                 .apiInfo(new ApiInfoBuilder()
                            .title("Spring Boot project")
                            .description("Spring Boot bootstrap project")
                            .version("0.1")
                            .license("Unlicense")
                            .build())
                  .select()  
                  .apis(RequestHandlerSelectors.basePackage("com.errabi.qfactory.repositories"))             
                  .paths(PathSelectors.any())                          
                  .build();  
     }




}
Run Code Online (Sandbox Code Playgroud)

这是我正在使用的依赖项:

<dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>2.9.2</version>
    </dependency>

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-data-rest</artifactId>
        <version>2.9.2</version>
    </dependency> …
Run Code Online (Sandbox Code Playgroud)

java swagger spring-data-rest spring-boot springfox

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

如何将 applicationContext.xml 中的对象转换为 java 注释

我正在开发一个 spring mvc 项目,我想转换我在我在 spring mvc 3 上工作时编写的 applicationContext.xml 中的 jpa 配置,现在我想转移到 spring Mvc 4 并编写我所有的 Jpa仅使用 Java 注释的配置有人可以帮助我

这是我的 applicationContext 文件:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">


 <bean id="datasource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
  <property name="url" value="jdbc:mysql://localhost:3306/db_adpub"></property>
  <property name="username" value="root"></property>
  <property name="password" value=""></property>
  </bean>

<bean id="persistenceUnitManager" class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
<property name="persistenceXmlLocations">
 <list>
    <value>classpath*:META-INF/persistence.xml</value>
  </list>
</property>
<property name="defaultDataSource" ref="datasource"></property>
</bean>

<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
   <property name="persistenceUnitManager" ref="persistenceUnitManager"></property>
   <property name="persistenceUnitName" value="adpub"></property>
</bean>

<bean id="transactionManager" …
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc entitymanager spring-data-jpa

5
推荐指数
1
解决办法
1131
查看次数

Spring数据查询dsl如何添加order by?

我是 Querydsl 的新手,我正在使用 Spring 数据和 Querydsl 来制作动态过滤器,我使用接口:QueryDslPredicateExecutor所以我可以使用不同的实体字段过滤数据,现在我想在我的查询中添加“order by”基于BooleanExpression

这是我的代码:

QPersonData _personInventory = QPersonData.personData;
BooleanBuilder query = new BooleanBuilder();

query.and(_personInventory.status.eq(status));
Run Code Online (Sandbox Code Playgroud)

然后我使用查询调用了我的存储库接口:

personInventoryRepository.findAll(query, pageable);
Run Code Online (Sandbox Code Playgroud)

我的问题是如何根据实体上的不同字段将“order by”应用于查询对象?

java spring querydsl spring-data spring-data-jpa

5
推荐指数
3
解决办法
4986
查看次数

如何使用css @media print打印时从表中删除边框

你好我尝试从用户单击按钮打印(window.print)时使用css删除我的表格边框,但它始终保持打印页面

这是我的css代码:

    @media print{

    body * {visibility: hidden;


    }

    table {
        border:solid; white !important;
        border-width:1px 0 0 1px !important;
        border-bottom-style: none;
    }
    th, td{
        border:solid; white !important;
        border-width:0 1px 1px 0 !important;
        border-bottom-style: none;
    }
}
Run Code Online (Sandbox Code Playgroud)

这个css给了我这个结果:

在此输入图像描述

表的底部边框显示如何删除它谢谢你

html css css3 media-queries

4
推荐指数
2
解决办法
3751
查看次数

如何使用Java屏蔽十六进制int?

我有一个包含hexa值的整数.我想从这个hexa值中提取第一个字符,就像它是一个String值,但我不想将它转换为String.

int a = 0x63C5;
int afterMask= a & 0xFFF;
System.out.println(afterMask); // this gives me "3C5" but I want to get the value "63C" 
Run Code Online (Sandbox Code Playgroud)

在我的情况下,我不能使用像substring.

java hex

4
推荐指数
2
解决办法
1103
查看次数