小编Mic*_* J.的帖子

使用jQuery设置输入值后更新Angular模型

我有这个简单的场景:

输入元素,其值由jQuery的val()方法更改.

我试图用jQuery设置的值更新角度模型.我试着编写一个简单的指令,但它并没有按照我的意愿行事.

这是指令:

var myApp = angular.module('myApp', []);
myApp.directive('testChange', function() {
    return function(scope, element, attrs) {        
        element.bind('change', function() {
            console.log('value changed');
        })
    }
})
Run Code Online (Sandbox Code Playgroud)

这是jQuery的一部分:

$(function(){
    $('button').click(function(){
        $('input').val('xxx');
    })
})
Run Code Online (Sandbox Code Playgroud)

和HTML:

<div ng-app="myApp">
    <div ng-controller="MyCtrl">
        <input test-change ng-model="foo" />
        <span>{{foo}}</span>
    </div>
</div>

<button>clickme</button>
Run Code Online (Sandbox Code Playgroud)

这是我尝试的小提琴:http:
//jsfiddle.net/U3pVM/743/

有人可以指点我正确的方向吗?

jquery bind directive angularjs

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

如何将Apache CXF Web服务部署到Glassfish

我有一个使用Apache CXF生成和构建的Web服务客户端.接下来我有JAX-RS Jersey应用程序,我想从该webservice调用方法.当我尝试将这个简单的项目部署到Glassfish 4.0服务器时,我得到以下异常:

Exception while deploying the app [pelijee] :
The lifecycle method [finalizeConfig] must not throw a checked exception.
Related annotation information: annotation [@javax.annotation.PostConstruct()] on annotated element [public void org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.finalizeConfig() throws java.security.GeneralSecurityException,java.io.IOException] of type [METHOD]. Please see server.log for more details.
Run Code Online (Sandbox Code Playgroud)

命令部署失败.

我在这个项目中唯一的CXF依赖是:

    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-bundle-jaxrs</artifactId>
        <version>2.7.6</version>
        <type>jar</type>
        <scope>runtime</scope>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

是否还有其他与JSR 250兼容的CXF库?谢谢

web-services cxf java-ee jsr250

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

调用webservice的问题 - javax.xml.ws.WebServiceException和类没有名称的属性

我有一个wsdl文件,很多xsd文件,jxb绑定文件.我使用Apache CXF cxf-codegen-plugin创建了一个Web服务客户端.创建Java类没有任何错误.但是当我尝试调用任何生成的方法时,我得到一个例外:

Exception in thread "main" javax.xml.ws.WebServiceException: class com.amadeus.xml.pnracc_11_1_1a.PNRReply do not have a property of the name {http://xml.amadeus.com/PNRACC_11_1_1A}PNR_Reply
Run Code Online (Sandbox Code Playgroud)

我像这样调用webservice方法(不要担心空值):

AmadeusWebServices aws = new AmadeusWebServices();
aws.getAmadeusWebServicesPort().fareMasterPricerCalendar(null, null);
Run Code Online (Sandbox Code Playgroud)

堆栈跟踪:

Exception in thread "main" javax.xml.ws.WebServiceException: class com.amadeus.xml.pnracc_11_1_1a.PNRReply do not have a property of the name {http://xml.amadeus.com/PNRACC_11_1_1A}PNR_Reply
at com.sun.xml.internal.ws.client.sei.ValueSetter$AsyncBeanValueSetter.<init>(ValueSetter.java:165)
at com.sun.xml.internal.ws.client.sei.ValueSetterFactory$AsyncBeanValueSetterFactory.get(ValueSetterFactory.java:67)
at com.sun.xml.internal.ws.client.sei.SEIMethodHandler.buildResponseBuilder(SEIMethodHandler.java:163)
at com.sun.xml.internal.ws.client.sei.AsyncMethodHandler.<init>(AsyncMethodHandler.java:121)
at com.sun.xml.internal.ws.client.sei.PollingMethodHandler.<init>(PollingMethodHandler.java:39)
at com.sun.xml.internal.ws.client.sei.SEIStub.initMethodHandlers(SEIStub.java:99)
at com.sun.xml.internal.ws.client.sei.SEIStub.<init>(SEIStub.java:73)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:590)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:330)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:312)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:294)
at javax.xml.ws.Service.getPort(Service.java:119)
at com.amadeus.xml.AmadeusWebServices.getAmadeusWebServicesPort(AmadeusWebServices.java:78)
at com.mycompany.test1.App.main(App.java:16)
Caused by: javax.xml.bind.JAXBException: {http://xml.amadeus.com/PNRACC_11_1_1A}PNR_Reply is not a valid …
Run Code Online (Sandbox Code Playgroud)

java xsd wsdl web-services cxf

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

标签 统计

cxf ×2

web-services ×2

angularjs ×1

bind ×1

directive ×1

java ×1

java-ee ×1

jquery ×1

jsr250 ×1

wsdl ×1

xsd ×1