小编Mar*_*ayi的帖子

将JSON转换为POJO

我正在使用Jersey for REST WS,我将我的响应作为JSON.我想将此响应转换为POJO.怎么做 ?日Thnx

java json jersey

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

Spring 3:找不到AuthenticationProcessingFilter

我无法找到AuthenticationProcessingFilter从何时迁移Spring 2Spring 3(使用spring-core)

spring-security spring-3

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

使用Gmail帐户在JBoss中配置mail-service.xml

我想配置mail-service.xml以从我的Gmail帐户发送电子邮件.我已经进行了配置,但它不起作用

<?xml version="1.0" encoding="UTF-8"?>
<server>
  <mbean code="org.jboss.mail.MailService"
         name="jboss:service=Mail">
    <attribute name="JNDIName">java:/Mail</attribute>
    <attribute name="User">***@gmail.com</attribute>
    <attribute name="Password">***</attribute>
    <attribute name="Configuration">
      <configuration>
        <property name="mail.smtp.auth" value="true"/>
        <property name="mail.smtp.starttls.enable" value="true"/>
        <property name="mail.smtp.socketFactory.class" value="javax.net.ssl.SSLSocketFactory"/>

        <!-- Change to your mail server prototocol -->
        <property name="mail.store.protocol" value="pop3"/>
        <property name="mail.transport.protocol" value="smtp"/>

        <!-- Change to the user who will receive mail  -->
        <property name="mail.user" value="nobody"/>

        <!-- Change to the mail server  -->
        <property name="mail.pop3.host" value="pop3.nosuchhost.nosuchdomain.com"/>

        <!-- Change to the SMTP gateway server -->
        <property name="mail.smtp.host" value="smtp.gmail.com"/>

        <!-- The mail server port --> …
Run Code Online (Sandbox Code Playgroud)

email gmail jboss

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

更改com.sun.org.apache.xml.internal.serialize.XMLSerializer和com.sun.org.apache.xml.internal.serialize.OutputFormat

使用com.sun.org.apache.xml.internal.serialize.XMLSerializercom.sun.org.apache.xml.internal.serialize.OutputFormat使用Java 1.6进行编译时会导致一些错误。我发现的解决方案是使用xerces org.apache.xml.serialize.XMLSerializerorg.apache.xml.serialize.OutputFormat添加xerces之后。问题是这些类已被弃用。在不接触代码的情况下,不用替换它们又能做什么?Thnx这是我使用的依赖项:

<dependency>
    <groupId>xerces</groupId>
    <artifactId>xercesImpl</artifactId>
    <version>2.9.1</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

java xml dependencies xerces

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

脚本java:从外部文件导入类

我想导入一个我已经在外部文件夹中编写的类,例如:我的类Example.java位于c:\class\Example.java我的脚本中,就像使用一样

var importedClass = new JavaImporter("c:\\class\\Example.java");
Run Code Online (Sandbox Code Playgroud)

要么

importClass("c:\\class\\Example.java");
Run Code Online (Sandbox Code Playgroud)

这是在ScriptEngine rhino的脚本
中我该怎么做?

java scripting mozilla rhino jdk1.6

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

在Scripting java(javax.script)中导入一个类

我想将我在项目中创建的类导入到我的脚本中,但是它不起作用:

    function doFunction(){
 //Objectif Mensuel
 importPackage(java.lang);
 importClass(KPDataModel.KPData.KPItem); //ERROR HERE, this is my class that I want to import

 KPItem kpItem = kpItemList.get(0);
 System.out.println(kpItem.CellList.get(2).Value);
 System.out.println("-------");
 var proposedMediationSum = Integer.parseInt(kpItemList.get(0).CellList.get(2).Value);
 var refusedMediationSum = Integer.parseInt(kpItemList.get(0).CellList.get(3).Value)
 var totalMediation = proposedMediationSum + refusedMediationSum;

 kpItemList.get(0).CellList.get(4).Value = totalMediation;

}
Run Code Online (Sandbox Code Playgroud)

java scripting javax.script jdk1.6

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

EXTJS TextField帮助在一边

我想添加像?在TextField旁边,就好像鼠标一样,它显示了一些帮助我该怎么办呢.日Thnx

extjs

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

Struts 1:将jsp的值放入使用java List的表单中

在我的jsp中,我有一些像这样的字段:

<html:text property="field[0]" value="${fieldValue}" indexed="true">
<html:text property="field[1]" value="${fieldValue}" indexed="true">
<html:text property="field[2]" value="${fieldValue}" indexed="true">
<html:text property="field[3]" value="${fieldValue}" indexed="true">
Run Code Online (Sandbox Code Playgroud)

在我的表单中,我有一个java.util.list,我需要从顶部的字段填充:

private List<Double> field = new ArrayList<Double>();

public final List<Double> getField() {
    return field;
}
public final void setField(final List<Double> valeur) {
    this.field = valeur;
}
Run Code Online (Sandbox Code Playgroud)

问题是列表未填充.有任何想法吗 ???谢谢 !!

forms jsp struts struts-1

5
推荐指数
0
解决办法
6556
查看次数

尝试使用Jersey将JSON转换为POJO时出错

我这样做:

WebResource resource = client.resource(urlStr); 
resource.accept(MediaType.APPLICATION_JSON_TYPE, MediaType.APPLICATION_XML_TYPE);
GenericType<List<EMailInformations>> genericType = new GenericType<List<EMailInformations>>() {};
List<EMailInformations> response = null; 
try{ 
    response = resource.get(genericType); 
} catch (UniformInterfaceException ue) { 
    ClientResponse clientResponse = ue.getResponse(); 
}
Run Code Online (Sandbox Code Playgroud)

类EMailInformations

@XmlRootElement
public class EMailInformations {
    private long id;

    public EMailInformations(){

    }

    public EMailInformations(long id) {
        super();
        this.id = id;
    }
        //getters & setters ...
}
Run Code Online (Sandbox Code Playgroud)

一些JSON响应

{"cn":[{"id":"302","l":"7","d":1308239209000,"rev":14667,"fileAsStr":"TAICHIMARO, Marouane","_attrs":{"lastName":"TAICHIMARO","imAddress1":"other:......
Run Code Online (Sandbox Code Playgroud)

我收到了这个错误:

21 juin 2011 16:56:01 com.sun.jersey.api.client.ClientResponse getEntity
GRAVE: A message body reader for Java class java.util.List, and Java type java.util.List<fr.liberacces.pool.liferay.connecteur.modele.EMailInformations>, …
Run Code Online (Sandbox Code Playgroud)

java json jaxb jersey

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

压缩java中的HTTP请求

我想在发送它之前压缩我的HTTP请求.怎么办?我正在使用JBoss4.2作为服务器

java compression httprequest

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