小编ago*_*cal的帖子

获取<ui:insert>的name属性

我有一个带有标题和副标题的JSF模板:

<h3><ui:insert name="title"/></h3>
<hr/>
<h5><ui:insert name="subtitle"/></h5>
Run Code Online (Sandbox Code Playgroud)

使用此模板的所有页面都有标题,但并不总是一个副标题:

<ui:define name="title">My Title with no subtitle</ui:define>
Run Code Online (Sandbox Code Playgroud)

当没有副标题时,我不想要<hr/>标签.所以我真正想做的是检查是否subtitle为空,如果是,则忽略代码块.像这样的东西:

<h3><ui:insert name="title"/></h3>
<c:if test="#{not empty subtitle}">
    <hr/>
    <h5><ui:insert name="subtitle"/></h5>
<c:if>
Run Code Online (Sandbox Code Playgroud)

但当然<c:if test="#{not empty subtitle}">不行.我不知道如何访问subtitle变量的值.

任何的想法 ?

谢谢

jsf facelets

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

如何以编程方式确定Quarkus中的当前活动配置文件

在《 Quarkus 应用程序配置指南》中,它提到了如何使用配置文件(例如%dev.quarkus.http.port=8181)配置应用程序。

But is there a way to access a Profile (or Environment) API so I can log the active profiles ? For example something like Spring:

@ApplicationScoped
public class ApplicationLifeCycle {

    private static final Logger LOGGER = LoggerFactory.getLogger("ApplicationLifeCycle");

    @Inject Environment env;

    void onStart(@Observes StartupEvent ev) {
        LOGGER.info("The application is starting with profiles " + env.getActiveProfiles());
    }
Run Code Online (Sandbox Code Playgroud)

quarkus

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

JHipster JDL 不生成任何东西,因为必须传递数据库类型

我正在使用 Jhipster 4.5.3 从我创建的 JDL 文件生成一些代码。因为我无法生成任何内容,所以我使用了JDL 博客示例……并且我遇到了同样的问题。

JDL文档仍然提到:

您可以通过运行 jhipster import-jdl your-jdl-file.jh 从 JDL 文件生成实体

但是当我这样做时,我得到:

正在解析 jdl。{ name: 'NullPointerException', message: '必须传递解析的 JDL 内容和数据库类型。',

查看代码,看起来我们必须传递一个新参数,即数据库类型(BTW 文档中未提及)。再看代码,有不少数据库类型可供选择。但是我选择的任何数据库,我得到

错误:找不到 postgresql,请确保路径正确!

at Environment.error (/Users/agoncal/.config/yarn/global/node_modules/yeoman-environment/lib/environment.js:89:38)
at jdlFiles.forEach (/Users/agoncal/.config/yarn/global/node_modules/generator-jhipster/generators/import-jdl/index.js:42:34)
at Array.forEach (native)
at constructor.validate (/Users/agoncal/.config/yarn/global/node_modules/generator-jhipster/generators/import-jdl/index.js:40:31)
at Object.<anonymous> (/Users/agoncal/.config/yarn/global/node_modules/yeoman-generator/lib/index.js:417:23)
at /Users/agoncal/.config/yarn/global/node_modules/yeoman-generator/node_modules/run-async/index.js:25:25
at Promise (<anonymous>)
at /Users/agoncal/.config/yarn/global/node_modules/yeoman-generator/node_modules/run-async/index.js:24:19
at /Users/agoncal/.config/yarn/global/node_modules/yeoman-generator/lib/index.js:418:9
at runCallback (timers.js:800:20)
Run Code Online (Sandbox Code Playgroud)

任何的想法 ?

java jhipster jdl

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

标签 统计

facelets ×1

java ×1

jdl ×1

jhipster ×1

jsf ×1

quarkus ×1