English 中文(简体)
JSF 2 - 多个页子中的单子
原标题:JSF 2 - Unique ids across multiple pages

I m 期待着建立一个共同基金应用程序,在浏览器的不同区域展示出多个xhtml页。 我可以用金字塔来这样做,但是如果金字塔不是三维,它们会增加额外的记忆和接触物体。

我正在考虑采用一种办法,在主页内使用亚x装载不同的xhtml页。 问题在于,主页内有许多内容将产生同样的遗症,因为女方仅在各自的观点内独一无二。

我知道1个解决办法是执行一些处理这些重复ids的客户方逻辑,但最好不要完全重复。

解决问题可以做些什么?

次要问题: 是否有框架更好地处理这一要求,即在同一浏览器窗口中展示多页?

最佳回答

http://java.sun.com/javaee/6/docs/api/javax/faces/component/NamingContainer.html

<?xml version= 1.0  encoding= UTF-8 ?>
<faces-config version="2.0"
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <component>
    <component-type>javax.faces.ViewRoot</component-type>
    <component-class>components.ReplacementRoot</component-class>
  </component>
</faces-config>

这一样本实施产生了<代码>clientId。 以<代码>为基础 意见 Id:

public class ReplacementRoot extends UIViewRoot implements NamingContainer {
  @Override
  public String getClientId(FacesContext context) {
    return "jsf" + getViewId().replaceAll("[^\p{Alnum}]", "_");
  }
}

这将产生以下表格的客户识别符号:jsf_index_xhtml:foo

问题回答




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签