我正在尝试创建一个AppFuse原型,用于使用Spring源创建一个使用Hibernate,Spring和Spring MVC的Web应用程序.
但是我收到以下错误.
Unable to create project from archetype [org.appfuse.archetypes:appfuse-basic-spring:RELEASE]
The defined artifact is not an archetype
Run Code Online (Sandbox Code Playgroud)
以下是截图.

我们正在使用spring security在我们的应用程序中从LDAP验证用户.身份验证部分正常工作但授权部分无法正常工作.
我们无法从LDAP检索用户的角色.
从书"春季安全3"由彼得·Mularien
"这是因为Active Directory将组成员身份存储为用户自身的LDAP条目的属性.开箱即用(截至发布时),Spring Security不提供可配置为支持典型结构的LdapAuthoritiesPopulator Active Directory LDAP树."
下面是我的spring-security配置文件.
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
<http use-expressions="true" >
<intercept-url pattern="/resources/**" filters="none" />
<intercept-url pattern="/login" access="permitAll"/>
<intercept-url pattern="/**" access="isAuthenticated()" />
<form-login login-page="/login"
default-target-url="/home"
always-use-default-target="true"
authentication-failure-url="/login?login_error=1" />
<logout invalidate-session="true"
logout-success-url="/"
logout-url="/logout"/>
</http>
<authentication-manager alias="ldapAuthenticationManager">
<authentication-provider ref="ldapAuthenticationProvider"/>
</authentication-manager>
<beans:bean id="ldapAuthenticationProvider" class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider">
<beans:constructor-arg ref="ldapBindAuthenticator"/>
<beans:constructor-arg ref="ldapAuthoritiesPopulator"/>
<beans:property name="userDetailsContextMapper" ref="ldapUserDetailsContextMapper"/>
</beans:bean>
<beans:bean id="ldapServer" class="org.springframework.security.ldap.DefaultSpringSecurityContextSource">
<!-- MS Active Directory -->
<beans:constructor-arg value="ldap://localhost:389/dc=myOrg,dc=net"/>
<beans:property …Run Code Online (Sandbox Code Playgroud) 我需要使用java将excel表中的数据上传到数据库.
数据库将是oracle.
用户使用Web应用程序(Spring MVC前端)每月上传一次excel表.
excel表将具有数千个记录/行,例如大约15000或更多.
请帮忙/
如何设置垂直条的样式,即"|"?我需要改变"|"的宽度和高度.
这就是我想要做的.
<a href="link1"> Link 1 </a> | <a href="link2"> Link 2 </a>
Run Code Online (Sandbox Code Playgroud) 我们在基于Java的Web应用程序中使用Display标记库.
除了使用显示标记库来显示列表之外,我们还使用它将数据导出到excel表,这样工作正常.
问题是数据包含在Excel工作表列中.
我需要单击单元格以展开单元格以查看完整数据.
有没有办法防止这种数据包裹?Excel工作表单元格可以根据其中的数据宽度进行调整吗?
我有两个数组列表.每个都有Employee类型的对象列表.
Employee类如下所示
public class Employee {
Employee(String firstname, String lastname, String employeeId) {
this.firstname = firstname;
this.lastname = lastname;
this.employeeId = employeeId;
}
private int id; // this is the primary key from employee table
private String firstname;
private String lastname;
private String employeeId; // manually assigned unique id to each employee
// getters and setters
}
Run Code Online (Sandbox Code Playgroud)
我需要根据员工对象的属性(员工ID)找到两个列表之间的差异.
员工ID是为每个员工手动生成的唯一ID.
import java.util.ArrayList;
import java.util.List;
public class FindDifferences {
public static void main(String args[]){
List<Employee> list1 = new ArrayList<Employee>();
List<Employee> list2 = …Run Code Online (Sandbox Code Playgroud) 我刚刚将 spring boot 版本更新到1.4.0。之后我收到类似的错误
Error:(109, 45) java: no suitable method found for findAll(com.mysema.query.types.Predicate,org.springframework.data.domain.Pageable)
method org.springframework.data.querydsl.QueryDslPredicateExecutor.findAll(com.querydsl.core.types.Predicate,org.springframework.data.domain.Sort) is not applicable
(argument mismatch; com.mysema.query.types.Predicate cannot be converted to com.querydsl.core.types.Predicate)
method org.springframework.data.querydsl.QueryDslPredicateExecutor.findAll(com.querydsl.core.types.Predicate,com.querydsl.core.types.OrderSpecifier<?>...) is not applicable
(argument mismatch; com.mysema.query.types.Predicate cannot be converted to com.querydsl.core.types.Predicate)
method org.springframework.data.querydsl.QueryDslPredicateExecutor.findAll(com.querydsl.core.types.OrderSpecifier<?>...) is not applicable
(varargs mismatch; com.mysema.query.types.Predicate cannot be converted to com.querydsl.core.types.OrderSpecifier<?>)
method org.springframework.data.querydsl.QueryDslPredicateExecutor.findAll(com.querydsl.core.types.Predicate,org.springframework.data.domain.Pageable) is not applicable
(argument mismatch; com.mysema.query.types.Predicate cannot be converted to com.querydsl.core.types.Predicate)
Run Code Online (Sandbox Code Playgroud)
升级之前,查询工作正常。
在我的 Spring Boot 应用程序中,我将有两种不同类型的用户,即
这些用户将存储在两个不同的表中。这两个表只有电子邮件 ID 是共同的。其他一切都会有所不同。
另外,没有。客户数量将非常庞大,例如 1 至 5 百万客户。另一方面,管理员用户很少,比如不到 10 个。因此有两个不同的表。
我想要两个不同的登录页面。一个位于 /customer/login 供所有客户使用,另一个位于 /admin/login 供所有管理员使用。登录详细信息应使用各自的表进行身份验证。登录时,客户应转到 /customer/home,管理员应转到 /admin/home。
注销时,客户应重定向到 /customer/login,管理员应重定向到 /admin/login
我正在使用 java 配置来实现 Spring 安全性。在 Spring Security 中如何做到这一点?
以下是我的单用户配置,可以正常工作。
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserDetailsService userDetailsService;
@Autowired
private AccessDecisionManager accessDecisionManager;
@Autowired
private ApplicationProperties applicationProperties;
@Bean
public Integer applicationSessionTimeout(){
return applicationProperties.getSecurity().getSessionTimeout();
}
@Bean
@Autowired
public AccessDecisionManager accessDecisionManager(AccessDecisionVoterImpl accessDecisionVoter) {
List<AccessDecisionVoter<?>> accessDecisionVoters = new ArrayList<AccessDecisionVoter<?>>(); …Run Code Online (Sandbox Code Playgroud) 我有两个 Spring Boot Web 应用程序。两个应用程序都有不同的数据库和不同的用户组。此外,这两个应用程序都使用 Spring Security 进行身份验证和授权,并且工作正常。
在任何给定点,我都会运行第一个应用程序的一个实例和运行第二个 Web 应用程序的多个实例。
我想公开第一个 Web 应用程序(运行一个实例)中的 REST API,并能够使用第二个 Web 应用程序(运行多个实例)中的 REST API。
如何确保可以通过正确的身份验证并仅通过第二个应用程序的实例安全地访问 REST API。
我们在基于gradle spring的MVC应用程序中使用flyway.我将我的SQL文件保存在src/main/resources/db/migration文件夹中.
下面是我的flyway gradle配置文件.
apply plugin: "org.flywaydb.flyway"
flyway {
driver = 'com.mysql.jdbc.Driver'
url = "jdbc:mysql://localhost:3306/java_app_test"
user = 'root'
password = ''
schemas = ['java_app_test']
outOfOrder = true
locations = [
//"filesystem:${project.projectDir}/dbScripts/migrations"
"classpath:db/migration"
]
}
Run Code Online (Sandbox Code Playgroud)
当我运行gradle flywayBaseline时,我得到如下输出.
13:57:06.291 [DEBUG] [org.flywaydb.core.internal.util.scanner.classpath.ClassPathScanner] Found resource: db/migration/20160121042238016__initial.sql
13:57:06.292 [DEBUG] [org.flywaydb.core.internal.util.scanner.classpath.ClassPathScanner] Found resource: db/migration/20160122081606826__initial.sql
13:57:06.311 [DEBUG] [org.flywaydb.core.internal.command.DbSchemas] Schema `java_app_test` already exists. Skipping schema creation.
13:57:06.358 [DEBUG] [org.flywaydb.core.internal.metadatatable.MetaDataTableImpl] MetaData table `java_app_test`.`schema_version` successfully updated to reflect changes
13:57:06.422 [INFO] [org.flywaydb.core.internal.command.DbBaseline] Schema baselined with version: 1
Run Code Online (Sandbox Code Playgroud)
它找到我的sql文件但它不执行它.
当我运行flywayMigrate时,我得到以下输出
14:12:41.285 …Run Code Online (Sandbox Code Playgroud) java ×4
spring-boot ×2
appfuse ×1
arraylist ×1
css ×1
database ×1
displaytag ×1
excel ×1
file-upload ×1
find ×1
flyway ×1
gradle ×1
ldap ×1
maven ×1
querydsl ×1
rest ×1
roles ×1
spring ×1
spring-mvc ×1