Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.

Commit

Permalink
Merge branch '2.2.8' of github.com:javaserverfaces/mojarra into 2.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyuan-zhang committed Jun 15, 2017
2 parents 454a03e + 1cef79f commit 0df96d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
15 changes: 5 additions & 10 deletions jsf-ri/src/main/java/com/sun/faces/renderkit/RenderKitUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1082,16 +1082,11 @@ public static void renderJsfJs(FacesContext context) throws IOException {
}
// Since we've now determined that it's not in the page, we need to add it.

ResourceHandler handler = context.getApplication().getResourceHandler();
Resource resource = handler.createResource(name, library);
ResponseWriter writer = context.getResponseWriter();
writer.write('\n');
writer.startElement("script", null);
writer.writeAttribute("type", "text/javascript", null);
writer.writeAttribute("src", ((resource != null) ? resource.getRequestPath() : ""), null);
writer.endElement("script");
writer.append('\r');
writer.append('\n');
UIOutput output = new UIOutput();
output.setRendererType("javax.faces.resource.Script");
output.getAttributes().put("name", name);
output.getAttributes().put("library", library);
output.encodeAll(context);

// Set the context to record script as included
setScriptAsRendered(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,9 @@

import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;

import com.sun.faces.config.WebConfiguration;
import com.sun.faces.config.WebConfiguration.BooleanWebContextInitParameter;
import com.sun.faces.renderkit.Attribute;
import com.sun.faces.renderkit.AttributeManager;
import com.sun.faces.renderkit.RenderKitUtils;
Expand All @@ -74,16 +71,9 @@ public class OutputLinkRenderer extends LinkRenderer {
private static final Attribute[] ATTRIBUTES =
AttributeManager.getAttributes(AttributeManager.Key.OUTPUTLINK);

protected boolean namespaceParameters;

// ---------------------------------------------------------- Public Methods


public OutputLinkRenderer() {
WebConfiguration webConfig = WebConfiguration.getInstance();
namespaceParameters = webConfig.isOptionEnabled(BooleanWebContextInitParameter.NamespaceParameters);
}

@Override
public void decode(FacesContext context, UIComponent component) {

Expand Down Expand Up @@ -230,17 +220,9 @@ protected void renderAsActive(FacesContext context, UIComponent component)
StringBuffer sb = new StringBuffer();
sb.append(hrefVal);
boolean paramWritten = (hrefVal.indexOf('?') > 0);
String namingContainerId = null;
if (namespaceParameters) {
UIViewRoot viewRoot = context.getViewRoot();
namingContainerId = viewRoot.getContainerClientId(context);
}
for (int i = 0, len = paramList.length; i < len; i++) {
String pn = paramList[i].name;
if (pn != null && pn.length() != 0) {
if (namingContainerId != null) {
pn = namingContainerId + pn;
}
String pv = paramList[i].value;
sb.append((paramWritten) ? '&' : '?');
sb.append(URLEncoder.encode(pn,"UTF-8"));
Expand Down

0 comments on commit 0df96d1

Please sign in to comment.