, . , , SEO.
, submit, :
<h:form>
<h:selectOneMenu value="#{bean.currentPage}" converter="pageConverter" onchange="submit()">
<f:selectItems value="#{bean.pages}" var="page" itemLabel="#{page.name}" />
</h:selectOneMenu>
<h:commandButton value="submit" action="#{bean.handleNavigation}" style="display:none"/>
</h:form>
@FacesConverter("pageConverter")
bean (@ManagedBean Bean)
private List<Page> pages;
private Page selectedPage;
public String handleNavigation(){
return (selectedPage == null) ? null : selectedPage.getUrl();
}
class Page {
private String name;
private String url;
}
Dropbox :
<h:form>
<h:selectOneMenu value="#{bean.currentPage}" converter="pageConverter">
<f:selectItems value="#{bean.pages}" var="page" itemLabel="#{page.name}" />
</h:selectOneMenu>
<h:commandButton value="Navigate" action="#{bean.performNavigation}"}/>
</h:form>
, .
<h:link> s
<h:link> s:
<ul>
<ui:repeat var="page" value="#{bean.pages}>
<li>
<h:link value="#{page.name}" outcome="#{page.url}" />
</li>
</ui:repeat>
</ul>
.
SEO
SEO , . URL- Page, , www.site.com/contact-us , www.site.com/contact.xhtml.
IMHO - Prettyfaces, , . URL- ( URL- JSF).
SEO , seoUrl Page, Prettyfaces, URL-, SEO (.. www.site.com/contact-us) JSF view-id ( .. www.site.com/contact.xhtml) -.
- URL
SEO- , Google, URL:
- URL- - ( Google);
- , URL . - , URL-
( , italics mine);
- URL- ( Google);
- ;
- URL-.
SEO:
:
- , URL-
www.site.com/contact-us.xhtml, 6 - www.site.com/contact-us ; - , ,
/pages/articles/general/how-to-do-jsf.xhtml, www.site.com/articles/how-to-do-jsf , , ; - , , (
jsf-bp.xhtml) (article23.xhtml), URL- www.site.com/article/jsf-best-practices-for-beginners; - ,
.xhtml, .jsf .., (, , ) , ( , ), , www.site.com/product.xhtml?id=12345, , (, , ) , URL- , , www.site.com/products/jsf-book-for-advanced-users. , , ; - (
?id=12345) (/jsf-book-for-advanced-users); - URL- .
www.site.com/products/jsf-book-for-advanced-users: URL , /jsf-book-for-advanced-users . , www.site.com/product.xhtml?name=jsf-book-for-advanced-users www.site.com/catalogue.xhtml ? , URL-; - , , SEO, ( ), , , stackoverflow.com.
I do not claim that the sources I refer to are indisputable or extremely authoritative, or their input requirements should apply to every web application, etc., but I believe that the well-structured, user-friendly sites that exist for a long time in production, as a rule, follow these rules.