小编Ale*_* Mi的帖子

对特定对象的实例方法的引用会破坏 Java 中的类型安全吗?

对特定对象的实例方法的引用的概念是否破坏了 Java 中的类型安全?

根据

https://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html

你可以有一个不实现 Comparator 接口的自定义类比较提供者,并且仍然使用这个类的实例作为方法的第二个参数

Arrays.sort(T[] a, 比较器 c)

当然,ComparisonProvider 的实现必须有一个方法,其签名与 Comparator.compare() 方法完全匹配,但这仍然不是 Comparator 的实例,不是吗?

本质上,Java 8 允许我们使用类的实例,就好像它们正在实现特定的接口一样,而实际上它们不是。

这意味着,我们正在失去 Java 中的类型安全性,对吗?

type-safety java-8 method-reference

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

在JBoss EAP 7中配置Http标头

你知道是否有一种标准方法来配置JBoss EAP 7发送给客户端的Http Headers?我主要对能够配置以下内容感兴趣:

  • X-XSS-保护
  • X-框架,选项
  • 严格,运输和安全
  • 内容安全,策略
  • X-Content-Type的选项

我在互联网上找到了这个链接

https://blog.akquinet.de/2017/08/03/wildfly-8-10-and-jboss-eap-7-verbose-http-headers/

但我不确定我是否可以将它用于我感兴趣的标题.

谢谢!

security jboss http http-headers jboss-eap-7

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

Your application has authenticated using end user credentials from the Google Cloud SDK which are not supported by the translate.googleapis.com

After reading similar questions, such as:

i am using gcp service account but when calling dialogue flow api its giving error :

and

Why is Google Cloud API trying to connect as an end-user?

and applying the suggested solutions I am still getting the error:

    Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden
{
  "code" : 403,
  "errors" : [ {
    "domain" : "usageLimits",
    "message" : "Your application has authenticated using end user credentials from the Google Cloud SDK or Google Cloud Shell …
Run Code Online (Sandbox Code Playgroud)

java authentication google-translate google-cloud-platform google-cloud-iam

3
推荐指数
2
解决办法
1168
查看次数

PrimeFaces 8 <p:fileUpload> 的工作方式与 PrimeFaces 7 不同

我最近从 PrimeFaces 7 迁移到 PrimeFaces 8,但该<p:fileUpload组件在 PrimeFaces 8 中没有按预期工作。这是最小的例子:

我的脸:

<!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:p="http://primefaces.org/ui"
          lang="en">

          <h:head>
           <f:facet name="first">
               <meta http-equiv="X-UA-Compatible" content="IE=edge" />
               <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
               <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
               <meta name="apple-mobile-web-app-capable" content="yes" />
           </f:facet>
          </h:head>
          <h:body>
                <h:outputStylesheet name="primeicons/primeicons.css" library="primefaces"/>

                <div class="ui-g ui-fluid"> 
                    <div class="card card-w-title">
                        <h:form id="inseratForm" enctype="multipart/form-data">  
                                <div class="card-title">Objekt anlegen</div> 
                                <p:growl id="messages" autoUpdate="true" showDetail="true" />  
                                <p:fileUpload 
                                        fileUploadListener="#{objAnlBean.handleFileUpload}"
                                        label="Select images" 
                                        auto="true"
                                        multiple="true"
                                        dragDropSupport="true"
                                        sizeLimit="100000000" 
                                        invalidSizeMessage=""
                                        invalidFileMessage="Invalid File"
                                        fileLimitMessage=""
                                        validatorMessage="Invalid File …
Run Code Online (Sandbox Code Playgroud)

migration jsf primefaces

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

PrimeFaces 从版本 xa 更新版本迁移

有关于将 PrimeFaces 从 7.0 迁移/更新/升级到最新 8 版本的指南吗?

我使用的是 PrimeFaces Sapphire 模板,它与 PrimeFaces 7.0 配合良好。但在迁移到最新的 8 版本时,我遇到了有关 PrimeFacesUploadedFile模型的编译问题。

migration primefaces

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

Quill 公开可用的 CSS

我最初的目的是从 PrimeFaces TextEditor 组件输出的 HTML 生成 PDF 文件,而该组件又基于免费开源的 WYSIWYG 编辑器 Quill。

为此,我需要获取 TextEditor 组件生成的 HTML,将其包含在<html>....中</html>,并提供生成 PDF 时要应用的 CSS 源。

这是我的文本在 PrimeFaces Web 应用程序中的样子:

在此输入图像描述

这是当我单击“Speichern”(保存)按钮时在调试器中得到的结果:

在此输入图像描述

如您所见,我有一个样式化但不完整的 HTML。请关注我感兴趣的部分:

<span class="ql-size-large">Hello, dear friends!</span>
Run Code Online (Sandbox Code Playgroud)

这直接取自 PrimeFaces 的调试器/文本编辑器组件。

现在,为了测试样式文本,我用<html><head><body>标签对其进行了扩充,现在它看起来像这样:

<html>
    <head> <link rel="stylesheet" href="http://cdn.quilljs.com/1.3.6/quill.snow.css"/>
    </head>
    <body>
        <p>
            <span class="ql-size-large">Hello, dear friends!</span>
        </p>
        <p>
            <br />
        </p>
        <p>I am glad to see ALL of you <span style="background-color:rgb( 230 , 0 , 0 )">today</span> here!
        </p>
    </body> …
Run Code Online (Sandbox Code Playgroud)

html css quill

0
推荐指数
1
解决办法
3875
查看次数