小编Kie*_*ran的帖子

jQuery <div>背景图片全尺寸拉伸

基本上我要做的是用纯HTML,CSS和jQuery重新创建这个站点.

目前该网站在搜索结果方面表现不佳,显然是因为它是Flash,所以这就是我想要解决的问题.

我正在寻找的是相当复杂的,但我很乐意为所需的任何单独部分采取解决方案,我将弄清楚如何将它们放在一起.我在互联网上搜索了高低,并打电话找到任何接近我想要的东西.

这就是我需要的.它主要是我担心的DIV图像......

  • 我有两个DIV,一个用于保存图像,另一个用于保存图像下方的链接.顶部DIV的高度为70%,第二个高度为30%.
  • 70%高度顶部DIV中的图像应该伸展至至少填充 DIV.我的意思是图像周围不应有空白区域,但显然图像也需要保持其宽高比.
  • 如果可能的话,我想让一些图像能够在这个DIV中以简单的淡入淡出效果旋转,可能是从XML文件加载(但不一定).

这是我的头脑还是很容易做到的?

谢谢你提供的所有帮助.

html css jquery image

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

Java ArrayList删除没有集合的dupes

我在从ArrayList中删除重复项时遇到问题.这是为了大学的任务.这是我已经拥有的代码:

public int numberOfDiffWords() {
    ArrayList<String> list = new ArrayList<>();
    for(int i=0; i<words.size()-1; i++) {
        for(int j=i+1; j<words.size(); j++) {
            if(words.get(i).equals(words.get(j))) {
                // do nothing
            }
            else  {
                list.add(words.get(i));
            }
        }
    }
    return list.size();
}
Run Code Online (Sandbox Code Playgroud)

问题出在numberOfDiffWords()方法上.填充列表方法工作正常,因为我的讲师给了我一个样本字符串(包含4465个单词)进行分析 - 打印words.size()给出了正确的结果.

我想返回新ArrayList的大小,删除所有重复项.

words 是一个ArrayList类属性.

更新:我应该提到我只允许在分配的这一部分使用基于动态索引的存储,这意味着没有基于散列的存储.

java arraylist

3
推荐指数
1
解决办法
188
查看次数

Spring Security配置自动装配自定义UserDetailsS​​ervice bean

我最近回到了一个我正在研究的S​​pring项目,并且在启动应用程序时遇到了问题.这个问题可能是重复的,但我一直无法找到答案.

这是我最初的SecurityConfig.java的一个片段:

@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired private UserService userService;

    /**
     * Global security config to set the user details service etc.
     * @param auth authentication manager
     * @throws Exception
     */
    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth
                .userDetailsService(userService)
                .passwordEncoder(passwordEncoder());
    }
Run Code Online (Sandbox Code Playgroud)

UserService对象实现UserDetailsS​​ervice.这在启动时给出了错误:

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.clubmate.web.service.UserService com.clubmate.web.config.SecurityConfig.userService; nested exception is java.lang.IllegalArgumentException: Can not set com.clubmate.web.service.UserService field com.clubmate.web.config.SecurityConfig.userService to com.sun.proxy.$Proxy62
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
    ... 58 more
Caused …
Run Code Online (Sandbox Code Playgroud)

spring spring-security autowired

3
推荐指数
1
解决办法
2066
查看次数

标签 统计

arraylist ×1

autowired ×1

css ×1

html ×1

image ×1

java ×1

jquery ×1

spring ×1

spring-security ×1