我看到了許多使用格式化 html 的 Active Choices Reactive Parameter 示例,但這些示例都沒有使用 HTML 選擇輸入型別。
這是我的 html 片段(為簡潔起見,簡化了 json_files 的輸入):
def json_files = ["a", "b", "c"]
html_to_be_rendered = """<select id="config" name="config">"""
json_files.each { json_file ->
html_to_be_rendered = """
${html_to_be_rendered}
<option value="${json_file}">${json_file}</option>
"""
}
return "${html_to_be_rendered}</select>"
我認為我應該能夠使用 ${config} 讀取選定的值,但似乎不起作用。
這就是我在 jenkins GUI 中定義它的方式:

我錯過了什么?
uj5u.com熱心網友回復:
您遇到的唯一問題是應該將的name屬性select硬編碼為value。不需要id屬性。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/318832.html
