|
36 | 36 | public class LinkRenderer extends Renderer |
37 | 37 | { |
38 | 38 | public static final String RENDERER_TYPE = "javax.faces.Link"; |
39 | | - private final PrettyURLBuilder urlBuilder = new PrettyURLBuilder(); |
| 39 | + protected final PrettyURLBuilder urlBuilder = new PrettyURLBuilder(); |
40 | 40 |
|
41 | 41 | @Override |
42 | 42 | public void encodeBegin(final FacesContext context, final UIComponent component) throws IOException |
@@ -73,8 +73,7 @@ public void encodeBegin(final FacesContext context, final UIComponent component) |
73 | 73 | PrettyConfig prettyConfig = prettyContext.getConfig(); |
74 | 74 | UrlMapping urlMapping = prettyConfig.getMappingById(mappingId); |
75 | 75 |
|
76 | | - String href = context.getExternalContext().getRequestContextPath() |
77 | | - + urlBuilder.build(urlMapping, true, urlBuilder.extractParameters(component)); |
| 76 | + String href = buildUrl(context, component, urlMapping); |
78 | 77 |
|
79 | 78 | if ((link.getAnchor() != null) && link.getAnchor().length() > 0) |
80 | 79 | { |
@@ -121,6 +120,11 @@ public void encodeBegin(final FacesContext context, final UIComponent component) |
121 | 120 |
|
122 | 121 | } |
123 | 122 |
|
| 123 | + protected String buildUrl(FacesContext context, UIComponent component, UrlMapping urlMapping) { |
| 124 | + return context.getExternalContext().getRequestContextPath() |
| 125 | + + urlBuilder.build(urlMapping, true, urlBuilder.extractParameters(component)); |
| 126 | + } |
| 127 | + |
124 | 128 | private void writeAttr(final ResponseWriter writer, final String name, final String value) throws IOException |
125 | 129 | { |
126 | 130 | if (value != null) |
|
0 commit comments