小编SJS*_*SJS的帖子

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

验证错误:"找不到类型的验证程序:java.lang.Integer"

我正在与Spring合作一个项目为什么我一直收到以下错误?

javax.validation.UnexpectedTypeException:
找不到类型的验证程序:java.lang.Integer


这是我的代码:

package com.s2rsolutions.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;

@Entity
@Table(name = "sales")
public class Sales {

    @NotEmpty(message = "The above field must not be blank.")
    @Column(name = "ttl_d_sls_lst_mth", nullable = false)
    private Integer ttl_d_sls_lst_mth;

    @NotEmpty(message = "The above field must not be blank.")
    @Column(name = "ttl_d_sls_6_mth", nullable = false)
    private Integer ttl_d_sls_6_mth;

    @NotEmpty(message = "The above field must not be blank.")
    @Column(name = "ttl_d_sls_mtht", nullable = false)
    private …
Run Code Online (Sandbox Code Playgroud)

java validation hibernate spring-mvc

63
推荐指数
4
解决办法
14万
查看次数

如何更改Java代码中的TextView值?

我正在研究一个android程序.用户单击按钮我做了一些数学运算,我想在一些TextView对象中更改我在视图上的值.有人可以告诉我如何在我的代码中执行此操作吗?

java android textview

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

如何使用LDIF删除LDAP中的一个属性?

如何使用LDIF删除LDAP中的一个属性?我试图删除uniqueMember: cn=jsmith,ou=users,dc=s2rsolutions,dc=com有人可以告诉我LDIF这样做吗?

dn: cn=USER,ou=groups,dc=s2rsolutions,dc=com
objectClass: groupOfUniqueNames
cn: USER
uniqueMember: cn=jsmith,ou=users,dc=s2rsolutions,dc=com
uniqueMember: cn=guest,ou=users,dc=s2rsolutions,dc=com
uniqueMember: cn=admin,ou=users,dc=s2rsolutions,dc=com
uniqueMember: cn=ford,ou=users,dc=s2rsolutions,dc=com
Run Code Online (Sandbox Code Playgroud)

ldap ldif

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

使用Spring authorize标签检查用户是否已登录时出错?

尝试测试以查看用户是否已登录我使用以下代码:

<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

<sec:authorize access="isAuthenticated()">
   YES, you are logged in!
</sec:authorize>
Run Code Online (Sandbox Code Playgroud)

但我得到以下的erorr?

javax.servlet.jsp.JspException: No visible WebSecurityExpressionHandler instance could be found in the application context. There must be at least one in order to support expressions in JSP 'authorize' tags.
        at org.springframework.security.taglibs.authz.AuthorizeTag.getExpressionHandler(AuthorizeTag.java:100)
        at org.springframework.security.taglibs.authz.AuthorizeTag.authorizeUsingAccessExpression(AuthorizeTag.java:58)
        at org.springframework.security.taglibs.authz.AuthorizeTag.doStartTag(AuthorizeTag.java:48)
Run Code Online (Sandbox Code Playgroud)

java jsp spring-security

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

如何在Spring-MVC中添加"required"属性

如何在Spring-MVC中添加"required"属性?

我希望结束标记看起来像这样

<input type="text" name="usrname" required>
Run Code Online (Sandbox Code Playgroud)

所以我在JSP中执行以下操作

<form:input path="usrname" maxlength="12" required/>
Run Code Online (Sandbox Code Playgroud)

但我得到一个错误

html java spring spring-mvc

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

Spring3,Hibernate; 我该如何使用HibernateTemplate

我试图更改以下代码使用:HibernateTemplate但不能正常工作

public List<Friend> listFriends(String rUser) 
{
    hibernateTemplate = new HibernateTemplate(sessionFactory);

    Friend friend = new Friend();
        friend.setUsername(rUser);

    // This is the old code that worked!
            return (List<Friend>) sessionFactory.getCurrentSession()
            .createCriteria(Friend.class)
            .add(Example.create(friend))
            .list();

        // This IS THE NEW CODE THAT I CANT GET TO BUILD?
            return (List<Friend>) hibernateTemplate.createCriteria(Friend.class)
            .add(Example.create(friend))
            .list();
}
Run Code Online (Sandbox Code Playgroud)

java mysql hibernate spring-mvc

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

尝试使用Spring LDAP进行编码

我正在尝试使用Spring LDAP进行编码

<ldap-server ldif="classpath:my-ldap-clone.ldif" />
Run Code Online (Sandbox Code Playgroud)

但是我得到了这个错误

NoClassDefFoundError: org/apache/directory/server/core/DirectoryService
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

java spring spring-security spring-ldap apacheds

7
推荐指数
3
解决办法
6333
查看次数

我在Github上使用Jekyll和Markdown作为我的博客.如何在页面中插入代码标签?

我在Github上使用Jekyll和Markdown作为我的博客.如何在页面中插入代码标签?

例子我以为我可以使用<pre>标签将一些代码捕捉插入我的页面以显示给读者,但是jekyll不喜欢它们.

有人可以告诉我一个好的格式标签,我可以用它在我的页面中插入代码

如果我尝试这个代码:

<pre>
  <code class="ruby">
git clone --mirror git@git.com:project project

cd project

git remote add github git@github.com:username/project.git


In cron Job

cd /pathto/project && git fetch -q && git push -q --mirror github
    </code>
</pre>
Run Code Online (Sandbox Code Playgroud)

我收到这个错误

在此输入图像描述

我的_config.xml

# This is the default format. 
# For more see: https://github.com/mojombo/jekyll/wiki/Permalinks
permalink: /:categories/:year/:month/:day/:title 

exclude: [".rvmrc", ".rbenv-version", "README.md", "Rakefile", "changelog.md"]
auto: true
pygments: true

# Themes are encouraged to use these universal variables 
# so be sure to set them if …
Run Code Online (Sandbox Code Playgroud)

markdown github jekyll

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

使用Spring处理战争之外的属性文件

我正在开发一个访问LDAP和两个数据库的Spring 3.0.5 Web应用程序.我有配置信息的属性的LDAP服务器和数据库,在applicationContext-security.xmldispatcher-servlet.xml,但我想使它所以每个服务器都可以有不同的数据属性,而无需在WAR更改文件.我可以以某种方式将文件放在服务器上的其他位置,并仍然可以从我的应用程序中访问它吗?

java spring tomcat jboss5.x

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