我需要创建一个Hibernate标准限制,或3条件.问题是最后一个条件是使用AND运算符的条件.
我的第一个条件:
Criterion startInRange = Restrictions.between("expectedStartCanonicDate",
rangeStart, rangeEnd);
Run Code Online (Sandbox Code Playgroud)
我的第二个条件:
Criterion endInRange = Restrictions.between("expectedCompletionCanonicDate",
rangeStart, rangeEnd);
Run Code Online (Sandbox Code Playgroud)
我的第三个条件需要和以下两个条件一起:
criteria.add(Restrictions.le("expectedStartCanonicDate", rangeStart));
criteria.add(Restrictions.ge("expectedCompletionCanonicDate", rangeEnd));
Run Code Online (Sandbox Code Playgroud)
我想要做的限制是condition1或condition2或condition3.我找到了让我接近的例子.我可以一起使用LogicalExpression或者前两个条件,但是,我不确定如何处理or3个条件,特别是当最后一个条件实际上是两个独立的条件anded时.
有什么想法吗?弗雷德
我有一个数据表
<p:dataTable id="db"
value="#{notificationBox.notificationsList}"
var="notificationForm"
rows="15"
emptyMessage="${msgs.getMessage('table.empty.message')}"
paginator="true"
paginatorPosition="bottom"
rowKey="#{notificationForm}"
selection="#{notificationBox.notification}"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} ( ${notificationBox.notificationsList.size()} ${msgs.getMessage('table.records')} )"
selectionMode="single"
tableStyle="height:430px">
//Rest of the code
Run Code Online (Sandbox Code Playgroud)
这里如果我选择任何一行,我将进行ajax调用(与primefaces即时行选择示例相同).Ajax在Datatable中.
<p:ajax event="rowSelect" listener="#{notificationBox.onRowSelect}"
oncomplete="carDialog.show();" />
Run Code Online (Sandbox Code Playgroud)
我的Backing Bean课程 -
private List<NotificationForm> notificationsList;
public NotificationForm notification;
public void onRowSelect(SelectEvent event) {
LOGGER.info("Here. +"+notification);
}
//Setter and Getters.
Run Code Online (Sandbox Code Playgroud)
问题是如果我选择任何行,"通知"将变为空.我无法进一步处理.请帮忙.任何替代方法也是受欢迎的.
编辑:-
我的托管Bean范围 -
<managed-bean>
<managed-bean-name>notificationBox</managed-bean-name>
<managed-bean-class>com.comviva.workflow.ui.notification.NotificationBox</managed-bean-class>
<managed-bean-scope>view</managed-bean-scope>
<managed-property>
<property-name>notificationDao</property-name>
<value>#{notificationDaoService}</value>
</managed-property>
<managed-property>
<property-name>userInfoDao</property-name>
<value>#{userInfoDaoProxy}</value>
</managed-property>
</managed-bean>
Run Code Online (Sandbox Code Playgroud) 由于Jersey 2.x在最新版本中弃用了LoggingFilter,我们继续使用Jersey自己的请求/响应日志记录以及log4j2.我们正在使用springboot.当我们使用POST方法访问Web服务时出现问题,它会抛出NegativeArraySizeException
java.lang.NegativeArraySizeException
at org.glassfish.jersey.logging.LoggingInterceptor.logInboundEntity(LoggingInterceptor.java:210) ~[jersey-common-2.23.2.jar:?]
at org.glassfish.jersey.logging.ServerLoggingFilter.filter(ServerLoggingFilter.java:108) ~[jersey-common-2.23.2.jar:?]
at org.glassfish.jersey.server.ContainerFilteringStage.apply(ContainerFilteringStage.java:132) ~[jersey-server-2.23.2.jar:?]
at org.glassfish.jersey.server.ContainerFilteringStage.apply(ContainerFilteringStage.java:68) ~[jersey-server-2.23.2.jar:?]
Run Code Online (Sandbox Code Playgroud)
我的log4j2配置 -
<!-- Jersey logger -->
<AsyncLogger name="org.glassfish" level="all" additivity="false">
<AppenderRef ref="Console" level="off" />
<AppenderRef ref="RollingFileIO" level="all" />
</AsyncLogger>
Run Code Online (Sandbox Code Playgroud)
如果我将日志级别设置为off,一切正常.SpringBoot版本1.4.3
只是为了安全检查,我能够在Wireshark中看到传入的数据.
我正在从外部源访问我的 servlet URL。参数之一是具有印地语文本。外部源正在对其进行编码。编码值为。
%E0%A4%AA%E0%A4%BE%E0%A4%A0%E0%A5%8D%E0%A4%AF%20%E0%A4%AD%E0%A4%BE%E0%A4%97
Run Code Online (Sandbox Code Playgroud)
我可以通过wireshark在TCP转储中看到它。但是我没有在 servlet 应用程序中得到这个编码的字符串。我正在尝试通过 getParameter() 方法获取它。它返回一些随机字符。
由于我没有得到正确的值,所以如果我尝试在我的 servlet 类中使用
URLDecoder.decode(myString, "UTF-8");
Run Code Online (Sandbox Code Playgroud)
然后它返回一些随机字符,就像这样 -
विषय वस�त�
Run Code Online (Sandbox Code Playgroud)
请建议我如何在 servlet 中读取此编码文本并将其解码回原始值。
我有一张地图来保存 json 条目。这是我的代码的预览。
mp := map[string]string{"key": "The Knight & Day"}
fmt.Println(mp)
bty3, err := json.Marshal(mp)
fmt.Println(bty3, err)
fmt.Println(string(bty3))
Run Code Online (Sandbox Code Playgroud)
输出如下-
map[key:The Knight & Day]
[123 34 107 101 121 34 58 34 84 104 101 32 75 110 105 103 104 116 32 92 117 48 48 50 54 32 68 97 121 34 125] <nil>
{"key":"The Knight \u0026 Day"}
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能保留特殊字符?
java ×2
go ×1
jersey-2.0 ×1
jsf ×1
jsf-2 ×1
json ×1
log4j2 ×1
primefaces ×1
servlets ×1
spring-boot ×1
stringify ×1
unicode ×1
urldecode ×1