Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's an option for you that still uses rest urls. It's not extremely elegant but probably accomplishes what you're looking for:</p> <pre><code>&lt;pretty:link mappingId="LanguageTopic"&gt; &lt;f:param name="link" value="#{currentTopic.link}" /&gt; &lt;f:param name="lang" value="eng" /&gt; English &lt;/pretty:link&gt; </code></pre> <p>pretty-config.xml:</p> <pre><code>&lt;url-mapping id="LanguageTopic"&gt; &lt;pattern value="/topic/#{link:linkBean.link}/#{lang:languageBean.lang}/" /&gt; &lt;view-id&gt;/faces/topic.jsf&lt;/view-id&gt; &lt;action&gt;#{linkBean.cleanUrl}&lt;/action&gt; &lt;/url-mapping&gt; &lt;url-mapping id="Topic"&gt; &lt;pattern value="/topic/#{link:linkBean.link}/" /&gt; &lt;view-id&gt;/faces/topic.jsf&lt;/view-id&gt; &lt;/url-mapping&gt; </code></pre> <p>language bean:</p> <pre><code>@ManagedBean(name = "languageBean") @SessionScoped public class LanguageBean implements Serializable { private static final long serialVersionUID = 4460586548949990787L; /** * Stores the users language preference */ private String lang; public String getLang() { return this.lang; } public void setLang(String lang) { this.lang = lang; } } </code></pre> <p>link bean:</p> <pre><code>@ManagedBean(name = "linkBean") @RequestScoped public class LinkBean { /** * Stores the resource the user is currently accessing */ private String link; public String getLink() { return this.link; } public void setLink(String link) { this.link = link; } /** * Cleans language specific rest urls to non-specific urls */ public void cleanUrl() { final ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); try { externalContext.redirect("/topic/" + this.link + "/"); } catch (IOException ex) { //log or whatever you want here } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload