在Spring 3 Web应用程序中实现JSON-RPC时,我需要一些推荐,最佳实践/库.
我发现了这个http://code.google.com/p/jsonrpc4j/但它似乎没有任何相关的可用.
编辑:
为了澄清,我想提供一个JSON-RPC服务
我有这个Kendo UI网格。它读取并填充网格。但是我面临的问题是,更新或删除按钮均未发送POST请求。
保存按钮不执行任何操作。删除按钮会给我一个确认警报框,然后将其删除到网格中,但没有任何请求。
<kendo:grid name="grid" pageable="true" groupable="false" editable="true" sortable="true" filterable="true" height="300" >
<kendo:grid-columns>
<kendo:grid-column title="Account" field="name"/>
<kendo:grid-column width="250">
<kendo:grid-column-command>
<kendo:grid-column-commandItem name="showAccount" text="Visa konto" click="showAccount"/>
<kendo:grid-column-commandItem name="ShowAccountSummary" text="Sammanställning" click="showAccountSummary"/>
</kendo:grid-column-command>
</kendo:grid-column>
<kendo:grid-column title=" " >
<kendo:grid-column-command>
<kendo:grid-column-commandItem name="save" />
<kendo:grid-column-commandItem name="destroy" />
</kendo:grid-column-command>
</kendo:grid-column>
</kendo:grid-columns>
<kendo:dataSource pageSize="10" batch="false">
<kendo:dataSource-schema>
<kendo:dataSource-schema-model id="id">
<kendo:dataSource-schema-model-fields>
<kendo:dataSource-schema-model-field name="id" type="number"/>
<kendo:dataSource-schema-model-field name="user_id" type="number"/>
<kendo:dataSource-schema-model-field name="name" type="string"/>
</kendo:dataSource-schema-model-fields>
</kendo:dataSource-schema-model>
</kendo:dataSource-schema>
<kendo:dataSource-transport>
<kendo:dataSource-transport-read url="${transportReadUrl}" dataType="json" type="GET" contentType="application/json" />
<kendo:dataSource-transport-update url="${updateAccountUrl}" dataType="json" type="POST" contentType="application/json" />
<kendo:dataSource-transport-destroy url="${destroyUrl}" dataType="json" type="POST" contentType="application/json" …Run Code Online (Sandbox Code Playgroud) 我有一个现有的 Spring Boot 应用程序,我希望将其作为我其他项目的依赖项。我想使用 Spring Boot 应用程序中的类。
Maven 下载工件并检查所有内容,但 intellij 和 eclipse 找不到这些类。
当我深入研究外部库时,我在 jar 内的“BOOT-INF”文件夹中找到了所有类。其他 jar 包在 jar 的根目录中,所以我认为这就是问题所在。
我能做些什么来解决这个问题?
我可以更改原始 Spring Boot 应用程序中的内容。
当我从服务器收到 404(未找到)时,我试图WebClient返回一个Optional.empty()。但相反,我得到了一个 OptionalUser对象,所有属性都设置为 null。
我错过了什么?
@Override
public Optional<User> getUser(Username username) {
return webClient
.get()
.uri(buildUrl(username))
.retrieve()
.onStatus(HttpStatus.NOT_FOUND::equals, response -> Mono.empty())
.onStatus(HttpStatus::is4xxClientError, response -> createError(response, CLIENTERROR))
.onStatus(HttpStatus::is5xxServerError, response -> createError(response, SERVRERROR))
.bodyToMono(User.class)
.blockOptional();
}
Run Code Online (Sandbox Code Playgroud) 有没有办法配置 PostgreSQL,以便当我运行“从 table_a 中删除”;它输出一些信息,有多少条目被级联删除。
我在 cli 应用程序中运行我的查询。
我在尝试映射JPA中的一对一关系时得到org.xml.sax.SAXParseException
一切都很好,直到我改变
<transient name="testCase"/>
至:
<attributes>
..
<one-to-one name="testCase">
<join-column name="test_case_id"/>
</one-to-one>
..
</attributes>
Run Code Online (Sandbox Code Playgroud)
给出错误:
引起:org.xml.sax.SAXParseException:cvc-complex-type.2.4.a:找到以元素"一对一"开头的无效内容.其中一个'{"http://java.sun.com/xml/ns/persistence/orm":many-to-many,,http://java.sun.com/xml/ns/persistence/orm":嵌入式,"http://java.sun.com/xml/ns/persistence/orm":transient}"是预期的.
我不明白异常消息的含义.为什么会出现这种情况?
我正在尝试在 mybatis 映射器中删除一个表,但是。
<update id="dropTable" parameterType="String">
DROP TABLE #{name}
</update>
Run Code Online (Sandbox Code Playgroud)
这会生成如下查询:
删除表“TEMP_TABLE”;
Oracle 不喜欢这种语法。我正在寻找一种方法来添加 #{name} 参数而不使用“'”字符。
是否可以根据正则表达式中的前一行匹配位置找到一个字符?
匹配的字符没有固定位置。
例子。# 符号位于第一行的位置将匹配下一行的字符值。
这将给出:2
X#ZEAKBLA
123456789
Run Code Online (Sandbox Code Playgroud)
这将给出: 7
XIZEAK#LA
123456789
Run Code Online (Sandbox Code Playgroud) 我使用在Tomcat7上运行的Eclipse构建了一个CXF + Spring Web服务.Web服务工作,但它不会从我的一个类创建复杂类型.
我的Eclipse项目叫做:"ws-server".在构建路径中,我添加了API-A,API-A-Impl和API-B.
构建路径是正确的.所有库都按照应有的方式进行部署.wsdl已创建,但API-B中没有复杂类型(API-B中只有一个类,Page).
在wsdl中,Page类在其他复杂类型中定义如下.
<xs:complexType name="getAllMeasuremenetObjectsByPage">
<xs:sequence>
<xs:element minOccurs="0" name="page"/>
<xs:element minOccurs="0" name="orderBy" type="xs:string"/>
<xs:element minOccurs="0" name="orderDirection" type="tns:orderDirection"/>
</xs:sequence>
</xs:complexType>
Run Code Online (Sandbox Code Playgroud)
我不知道从哪里开始寻找.感觉CXF有什么东西.我认为Eclipse项目配置没有任何问题.Web服务中没有"page"参数的所有其他方法都有效.
java ×3
spring ×3
cxf ×1
debugging ×1
javascript ×1
jpa ×1
json-rpc ×1
jsp ×1
kendo-ui ×1
maven ×1
mybatis ×1
one-to-one ×1
oracle ×1
orm ×1
postgresql ×1
regex ×1
soap ×1
spring-boot ×1
sql ×1