JSF commandButton URL参数

栏目: Java · 发布时间: 7年前

内容简介:有解决方案吗?翻译自:https://stackoverflow.com/questions/3004620/jsf-commandbutton-url-parameters

有解决方案吗?

h:commandButton不会触发GET请求,而是触发POST请求,因此您无法使用它.如果您已经使用JSF 2.0并且目标页面位于相同的上下文中,那么您可以使用h:按钮:

<h:button value="press here" outcome="otherViewId">
    <f:param name="param1" value="value1" />
    <f:param name="param2" value="value2" />
</h:button>

(此处不需要h:表格,如h:outputLink).这将创建一个按钮,该按钮转到otherViewId.jsf?param1 = value1& param2 = value2.

但是如果你还没有使用JSF 2.0,那么你最好的方法就是抓住CSS来设置链接样式.

<h:outputLink styleClass="button">

有类似的东西

a.button {
    display: inline-block;
    background: lightgray;
    border: 2px outset lightgray;
    cursor: default;
}
a.button:active {
    border-style: inset;
}

翻译自:https://stackoverflow.com/questions/3004620/jsf-commandbutton-url-parameters


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Pro CSS and HTML Design Patterns

Pro CSS and HTML Design Patterns

Michael Bowers / Apress / April 23, 2007 / $44.99

Design patterns have been used with great success in software programming. They improve productivity, creativity, and efficiency in web design and development, and they reduce code bloat and complexit......一起来看看 《Pro CSS and HTML Design Patterns》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器