CPD Results
The following document contains the results of PMD's CPD 4.2.5.
Duplications
| File | Line |
|---|---|
| org/apache/myfaces/webapp/filter/portlet/PortletExternalContextWrapper.java | 270 |
| org/apache/myfaces/webapp/filter/servlet/ServletExternalContextWrapper.java | 289 |
_sessionMap = new SessionMap((HttpServletRequest) _servletRequest);
}
return _sessionMap;
}
else
{
return _delegate.getSessionMap();
}
}
public Principal getUserPrincipal() {
return _delegate.getUserPrincipal();
}
public boolean isUserInRole(String role) {
return _delegate.isUserInRole(role);
}
public void log(String message) {
_delegate.log(message);
}
public void log(String message, Throwable exception) {
_delegate.log(message, exception);
}
public void redirect(String url) throws IOException {
_delegate.redirect(url);
}
//Methods since 1.2
public String getResponseContentType()
{
try
{
Method method = _delegate.getClass().getMethod(
"getResponseContentType",
null);
return (String) method.invoke(_delegate, null);
}
catch (NoSuchMethodException e)
{
throw new RuntimeException("JSF 1.2 method not implemented: "+e.getMessage());
}
catch (Exception e)
{
throw new RuntimeException("Error calling JSF 1.2 method: "+e.getMessage());
}
}
public void setRequest(java.lang.Object request)
{
try
{
Method method = _delegate.getClass().getMethod(
"setRequest",
new Class[]{java.lang.Object.class});
method.invoke(_delegate, new Object[]{request});
}
catch (NoSuchMethodException e)
{
throw new RuntimeException("JSF 1.2 method not implemented: "+e.getMessage());
}
catch (Exception e)
{
throw new RuntimeException("Error calling JSF 1.2 method: "+e.getMessage());
}
}
public void setRequestCharacterEncoding(java.lang.String encoding)
throws java.io.UnsupportedEncodingException{
try
{
Method method = _delegate.getClass().getMethod(
"setRequestCharacterEncoding",
new Class[]{java.lang.String.class});
method.invoke(_delegate, new Object[]{encoding});
}
catch (NoSuchMethodException e)
{
throw new RuntimeException("JSF 1.2 method not implemented: "+e.getMessage());
}
catch (Exception e)
{
throw new RuntimeException("Error calling JSF 1.2 method: "+e.getMessage());
}
}
public void setResponse(java.lang.Object response)
{
try
{
Method method = _delegate.getClass().getMethod(
"setResponse",
new Class[]{java.lang.Object.class});
method.invoke(_delegate, new Object[]{response});
}
catch (NoSuchMethodException e)
{
throw new RuntimeException("JSF 1.2 method not implemented: "+e.getMessage());
}
catch (Exception e)
{
throw new RuntimeException("Error calling JSF 1.2 method: "+e.getMessage());
}
}
public void setResponseCharacterEncoding(java.lang.String encoding)
{
try
{
Method method = _delegate.getClass().getMethod(
"setResponseCharacterEncoding",
new Class[]{java.lang.String.class});
method.invoke(_delegate, new Object[]{encoding});
}
catch (NoSuchMethodException e)
{
throw new RuntimeException("JSF 1.2 method not implemented: "+e.getMessage());
}
catch (Exception e)
{
throw new RuntimeException("Error calling JSF 1.2 method: "+e.getMessage());
}
}
public String getResponseCharacterEncoding()
{
try
{
Method method = _delegate.getClass().getMethod(
"getResponseCharacterEncoding",
null);
return (String) method.invoke(_delegate, null);
}
catch (NoSuchMethodException e)
{
throw new RuntimeException("JSF 1.2 method not implemented: "+e.getMessage());
}
catch (Exception e)
{
throw new RuntimeException("Error calling JSF 1.2 method: "+e.getMessage());
}
}
public String getRequestCharacterEncoding()
{
try
{
Method method = _delegate.getClass().getMethod(
"getRequestCharacterEncoding",
null);
return (String) method.invoke(_delegate, null);
}
catch (NoSuchMethodException e)
{
throw new RuntimeException("JSF 1.2 method not implemented: "+e.getMessage());
}
catch (Exception e)
{
throw new RuntimeException("Error calling JSF 1.2 method: "+e.getMessage());
}
}
} | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/util/StreamingAddResource.java | 644 |
| org/apache/myfaces/renderkit/html/util/NonBufferingAddResource.java | 335 |
throw new IllegalStateException(e.getMessage());
}
}
public String getResourceUri(FacesContext context, Class myfacesCustomComponent,
String resource, boolean withContextPath)
{
return getResourceUri(context,
new MyFacesResourceHandler(myfacesCustomComponent, resource), withContextPath);
}
public String getResourceUri(FacesContext context, Class myfacesCustomComponent, String resource)
{
return getResourceUri(context, new MyFacesResourceHandler(myfacesCustomComponent, resource));
}
/**
* Get the Path used to retrieve an resource.
*/
public String getResourceUri(FacesContext context, ResourceHandler resourceHandler)
{
String uri = resourceHandler.getResourceUri(context);
if (uri == null)
{
return getResourceUri(context, resourceHandler.getResourceLoaderClass(), true);
}
return getResourceUri(context, resourceHandler.getResourceLoaderClass(), true) + uri;
}
/**
* Get the Path used to retrieve an resource.
*/
public String getResourceUri(FacesContext context, ResourceHandler resourceHandler,
boolean withContextPath)
{
String uri = resourceHandler.getResourceUri(context);
if (uri == null)
{
return getResourceUri(context, resourceHandler.getResourceLoaderClass(),
withContextPath);
}
return getResourceUri(context, resourceHandler.getResourceLoaderClass(), withContextPath)
+ uri;
}
/**
* Get the Path used to retrieve an resource.
*/
public String getResourceUri(FacesContext context, String uri)
{
return getResourceUri(context, uri, true);
}
/**
* Get the Path used to retrieve an resource.
*/
public String getResourceUri(FacesContext context, String uri, boolean withContextPath)
{
if (withContextPath)
{
return context.getApplication().getViewHandler().getResourceURL(context, uri);
}
return uri;
}
/**
* Get the Path used to retrieve an resource.
* @param context current faces-context
* @param resourceLoader resourceLoader
* @param withContextPath use the context-path of the web-app when accessing the resources
*
* @return the URI of the resource
*/
protected String getResourceUri(FacesContext context, Class resourceLoader,
boolean withContextPath)
{
StringBuffer sb = new StringBuffer(200);
sb.append(MyfacesConfig.getCurrentInstance(context.getExternalContext()).getResourceVirtualPath());
sb.append(PATH_SEPARATOR);
sb.append(resourceLoader.getName());
sb.append(PATH_SEPARATOR);
sb.append(getCacheKey(context));
sb.append(PATH_SEPARATOR);
return getResourceUri(context, sb.toString(), withContextPath);
}
/**
* Return a value used in the {cacheKey} part of a generated URL for a
* resource reference.
* <p/>
* Caching in browsers normally works by having files served to them
* include last-modified and expiry-time http headers. Until the expiry
* time is reached, a browser will silently use its cached version. After
* the expiry time, it will send a "get if modified since {time}" message,
* where {time} is the last-modified header from the version it has cached.
* <p/>
* Unfortunately this scheme only works well for resources represented as
* plain files on disk, where the webserver can easily and efficiently see
* the last-modified time of the resource file. When that query has to be
* processed by a servlet that doesn't scale well, even when it is possible
* to determine the resource's last-modified date from servlet code.
* <p/>
* Fortunately, for the AddResource class a static resource is only ever
* accessed because a URL was embedded by this class in a dynamic page.
* This makes it possible to implement caching by instead marking every
* resource served with a very long expiry time, but forcing the URL that
* points to the resource to change whenever the old cached version becomes
* invalid; the browser effectively thinks it is fetching a different
* resource that it hasn't seen before. This is implemented by embedding
* a "cache key" in the generated URL.
* <p/>
* Rather than using the actual modification date of a resource as the
* cache key, we simply use the webapp deployment time. This means that all
* data cached by browsers will become invalid after a webapp deploy (all
* the urls to the resources change). It also means that changes that occur
* to a resource <i>without</i> a webapp redeploy will not be seen by browsers.
*
* @param context the current faces-context
*
* @return the key for caching
*/
protected long getCacheKey(FacesContext context)
{
// cache key is hold in application scope so it is recreated on redeploying the webapp.
Map applicationMap = context.getExternalContext().getApplicationMap();
Long cacheKey = (Long) applicationMap.get(RESOURCES_CACHE_KEY);
if (cacheKey == null)
{
cacheKey = new Long(System.currentTimeMillis() / 100000);
applicationMap.put(RESOURCES_CACHE_KEY, cacheKey);
}
return cacheKey.longValue();
}
public boolean isResourceUri(ServletContext servletContext, HttpServletRequest request)
{
String path;
if (_contextPath != null)
{
path = _contextPath + getResourceVirtualPath(servletContext);
}
else
{
path = getResourceVirtualPath(servletContext);
}
//fix for TOMAHAWK-660; to be sure this fix is backwards compatible, the
//encoded context-path is only used as a first option to check for the prefix
//if we're sure this works for all cases, we can directly return the first value
//and not double-check.
try
{
if(request.getRequestURI().startsWith(URLEncoder.encode(path,"UTF-8")))
return true;
}
catch (UnsupportedEncodingException e)
{
log.error("Unsupported encoding UTF-8 used",e);
}
return request.getRequestURI().startsWith(path);
}
private String getResourceVirtualPath(ServletContext servletContext) | |
| File | Line |
|---|---|
| org/apache/myfaces/webapp/filter/portlet/PortletChacheFileSizeErrorsFileUpload.java | 110 |
| org/apache/myfaces/webapp/filter/servlet/ServletChacheFileSizeErrorsFileUpload.java | 109 |
.getItemIterator(new ServletRequestContext(request));
FileItemFactory fac = fileUpload.getFileItemFactory();
if (fac == null)
{
throw new NullPointerException(
"No FileItemFactory has been set.");
}
long maxFileSize = this.getFileSizeMax();
long maxSize = this.getSizeMax();
boolean checkMaxSize = false;
if (maxFileSize == -1L)
{
//The max allowed file size should be approximate to the maxSize
maxFileSize = maxSize;
}
if (maxSize != -1L)
{
checkMaxSize = true;
}
while (iter.hasNext())
{
final FileItemStream item = iter.next();
FileItem fileItem = fac.createItem(item.getFieldName(), item
.getContentType(), item.isFormField(), item.getName());
long allowedLimit = 0L;
try
{
if (maxFileSize != -1L || checkMaxSize)
{
if (checkMaxSize)
{
allowedLimit = maxSize > maxFileSize ? maxFileSize : maxSize;
}
else
{
//Just put the limit
allowedLimit = maxFileSize;
}
long contentLength = getContentLength(item.getHeaders());
//If we have a content length in the header we can use it
if (contentLength != -1L && contentLength > allowedLimit)
{
throw new FileUploadIOException(
new FileSizeLimitExceededException(
"The field "
+ item.getFieldName()
+ " exceeds its maximum permitted "
+ " size of " + allowedLimit
+ " characters.",
contentLength, allowedLimit));
}
//Otherwise we must limit the input as it arrives (NOTE: we cannot rely
//on commons upload to throw this exception as it will close the
//underlying stream
final InputStream itemInputStream = item.openStream();
InputStream limitedInputStream = new LimitedInputStream(
itemInputStream, allowedLimit)
{
protected void raiseError(long pSizeMax, long pCount)
throws IOException
{
throw new FileUploadIOException(
new FileSizeLimitExceededException(
"The field "
+ item.getFieldName()
+ " exceeds its maximum permitted "
+ " size of "
+ pSizeMax
+ " characters.",
pCount, pSizeMax));
}
};
//Copy from the limited stream
long bytesCopied = Streams.copy(limitedInputStream, fileItem
.getOutputStream(), true);
// Decrement the bytesCopied values from maxSize, so the next file copied
// takes into account this value when allowedLimit var is calculated
// Note the invariant before the line is maxSize >= bytesCopied, since if this
// is not true a FileUploadIOException is thrown first.
maxSize -= bytesCopied;
}
else
{
//We can just copy the data
Streams.copy(item.openStream(), fileItem
.getOutputStream(), true);
}
}
catch (FileUploadIOException e)
{
try
{
throw (FileUploadException) e.getCause();
}
catch (FileUploadBase.FileSizeLimitExceededException se)
{
request
.setAttribute(
"org.apache.myfaces.custom.fileupload.exception",
"fileSizeLimitExceeded");
String fieldName = fileItem.getFieldName();
request.setAttribute(
"org.apache.myfaces.custom.fileupload."+fieldName+".maxSize",
new Integer((int)allowedLimit));
}
}
catch (IOException e)
{
throw new IOFileUploadException("Processing of "
+ FileUploadBase.MULTIPART_FORM_DATA
+ " request failed. " + e.getMessage(), e);
}
if (fileItem instanceof FileItemHeadersSupport)
{
final FileItemHeaders fih = item.getHeaders();
((FileItemHeadersSupport) fileItem).setHeaders(fih);
}
if (fileItem != null)
{
items.add(fileItem);
}
}
return items;
}
catch (FileUploadIOException e)
{
throw (FileUploadException) e.getCause();
}
catch (IOException e)
{
throw new FileUploadException(e.getMessage(), e);
}
}
} | |
| File | Line |
|---|---|
| org/apache/myfaces/tomahawk/application/jsp/JspTilesTwoViewHandlerImpl.java | 212 |
| org/apache/myfaces/tomahawk/application/jsp/JspTilesViewHandlerImpl.java | 247 |
}
}
private static ServletMapping getServletMapping(ExternalContext externalContext)
{
String servletPath = externalContext.getRequestServletPath();
String requestPathInfo = externalContext.getRequestPathInfo();
WebXml webxml = WebXml.getWebXml(externalContext);
List mappings = webxml.getFacesServletMappings();
boolean isExtensionMapping = requestPathInfo == null;
for (int i = 0, size = mappings.size(); i < size; i++)
{
ServletMapping servletMapping = (ServletMapping) mappings.get(i);
if (servletMapping.isExtensionMapping() == isExtensionMapping)
{
String urlpattern = servletMapping.getUrlPattern();
if (isExtensionMapping)
{
String extension = urlpattern.substring(1, urlpattern.length());
if (servletPath.endsWith(extension))
{
return servletMapping;
}
}
else
{
urlpattern = urlpattern.substring(0, urlpattern.length() - 2);
// servletPath starts with "/" except in the case where the
// request is matched with the "/*" pattern, in which case
// it is the empty string (see Servlet Sepc 2.3 SRV4.4)
if (servletPath.equals(urlpattern))
{
return servletMapping;
}
}
}
}
log.error("could not find pathMapping for servletPath = " + servletPath +
" requestPathInfo = " + requestPathInfo);
throw new IllegalArgumentException("could not find pathMapping for servletPath = " + servletPath +
" requestPathInfo = " + requestPathInfo);
}
public Locale calculateLocale(FacesContext context)
{
return _viewHandler.calculateLocale(context);
}
public String calculateRenderKitId(FacesContext context)
{
return _viewHandler.calculateRenderKitId(context);
}
public UIViewRoot createView(FacesContext context, String viewId)
{
return _viewHandler.createView(context, viewId);
}
public String getActionURL(FacesContext context, String viewId)
{
return _viewHandler.getActionURL(context, viewId);
}
public String getResourceURL(FacesContext context, String path)
{
return _viewHandler.getResourceURL(context, path);
}
public UIViewRoot restoreView(FacesContext context, String viewId)
{
return _viewHandler.restoreView(context, viewId);
}
public void writeState(FacesContext context) throws IOException
{
_viewHandler.writeState(context);
}
} | |
| File | Line |
|---|---|
| org/apache/myfaces/webapp/filter/MultipartRequestWrapper.java | 131 |
| org/apache/myfaces/webapp/filter/PortletMultipartRequestWrapper.java | 129 |
requestParameters = ((PortletChacheFileSizeErrorsFileUpload) fileUpload).
parseRequestCatchingFileSizeErrors(request, fileUpload);
}
else
{
requestParameters = fileUpload.parseRequest(request);
}
}
catch (FileUploadBase.FileSizeLimitExceededException e)
{
// Since commons-fileupload does not allow to continue processing files
// if this exception is thrown, we can't do anything else.
// So, the current request is rejected and we can't restore state, so
// this request is dealt like a new request, but note that caching the params
// below it is possible to detect if the current request has been aborted
// or not.
// Note that if cacheFileSizeErrors is true, this is not thrown, so the request
// is not aborted unless other different error occur.
request.setAttribute(
"org.apache.myfaces.custom.fileupload.exception","fileSizeLimitExceeded");
request.setAttribute("org.apache.myfaces.custom.fileupload.maxSize",
new Integer((int)maxFileSize));
if (log.isWarnEnabled())
log.warn("FileSizeLimitExceededException while uploading file.", e);
requestParameters = Collections.EMPTY_LIST;
}
catch (FileUploadBase.SizeLimitExceededException e)
{
// This exception is thrown when the max request size has been reached.
// In this case, the current request is rejected. The current
// request is dealt like a new request, but note that caching the params below
// params it is possible to detect if the current request has been aborted
// or not.
request.setAttribute(
"org.apache.myfaces.custom.fileupload.exception","sizeLimitExceeded");
request.setAttribute("org.apache.myfaces.custom.fileupload.maxSize",
new Integer((int)maxSize));
if (log.isWarnEnabled())
log.warn("SizeLimitExceededException while uploading file.", e);
requestParameters = Collections.EMPTY_LIST;
}
catch(FileUploadException fue)
{
if (log.isErrorEnabled())
log.error("Exception while uploading file.", fue);
requestParameters = Collections.EMPTY_LIST;
}
parametersMap = new HashMap( requestParameters.size() );
fileItems = new HashMap();
for (Iterator iter = requestParameters.iterator(); iter.hasNext(); ){
FileItem fileItem = (FileItem) iter.next();
if (fileItem.isFormField()) {
String name = fileItem.getFieldName();
// The following code avoids commons-fileupload charset problem.
// After fixing commons-fileupload, this code should be
//
// String value = fileItem.getString();
//
String value = null;
if ( charset == null) {
value = fileItem.getString();
} else {
try {
value = new String(fileItem.get(), charset);
} catch (UnsupportedEncodingException e){
value = fileItem.getString();
}
}
addTextParameter(name, value);
} else { // fileItem is a File
if (fileItem.getName() != null) {
fileItems.put(fileItem.getFieldName(), fileItem);
}
}
} | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/util/MultipartFilter.java | 73 |
| org/apache/myfaces/webapp/filter/ExtensionsFilter.java | 247 |
_servletContext = filterConfig.getServletContext();
}
private int resolveSize(String param, int defaultValue) {
int numberParam = defaultValue;
if (param != null) {
param = param.toLowerCase();
int factor = 1;
String number = param;
if (param.endsWith("g")) {
factor = 1024 * 1024 * 1024;
number = param.substring(0, param.length() - 1);
} else if (param.endsWith("m")) {
factor = 1024 * 1024;
number = param.substring(0, param.length() - 1);
} else if (param.endsWith("k")) {
factor = 1024;
number = param.substring(0, param.length() - 1);
}
numberParam = Integer.parseInt(number) * factor;
}
return numberParam;
}
private static boolean getBooleanValue(String initParameter, boolean defaultVal)
{
if(initParameter == null || initParameter.trim().length()==0)
return defaultVal;
return (initParameter.equalsIgnoreCase("on") || initParameter.equals("1") || initParameter.equalsIgnoreCase("true"));
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
if(request.getAttribute(DOFILTER_CALLED)!=null) | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/util/MultipartFilter.java | 77 |
| org/apache/myfaces/webapp/filter/MultipartRequestWrapperConfig.java | 51 |
private static int resolveSize(String param, int defaultValue)
{
int numberParam = defaultValue;
if (param != null)
{
param = param.toLowerCase();
int factor = 1;
String number = param;
if (param.endsWith("g"))
{
factor = 1024 * 1024 * 1024;
number = param.substring(0, param.length() - 1);
}
else if (param.endsWith("m"))
{
factor = 1024 * 1024;
number = param.substring(0, param.length() - 1);
}
else if (param.endsWith("k"))
{
factor = 1024;
number = param.substring(0, param.length() - 1);
}
numberParam = Integer.parseInt(number) * factor;
}
return numberParam;
}
private static boolean getBooleanValue(String initParameter, boolean defaultVal)
{
if(initParameter == null || initParameter.trim().length()==0)
return defaultVal;
return (initParameter.equalsIgnoreCase("on") || initParameter.equals("1") || initParameter.equalsIgnoreCase("true"));
}
public int getUploadMaxSize() | |
| File | Line |
|---|---|
| org/apache/myfaces/taglib/html/ext/HtmlSelectManyListboxTag.java | 43 |
| org/apache/myfaces/taglib/html/ext/HtmlSelectOneRadioTag.java | 44 |
return HtmlSelectOneRadio.DEFAULT_RENDERER_TYPE;
}
private String _escape;
private String _enabledOnUserRole;
private String _visibleOnUserRole;
private String _displayValueOnly;
private String _displayValueOnlyStyle;
private String _displayValueOnlyStyleClass;
public void release() {
super.release();
_escape=null;
_enabledOnUserRole=null;
_visibleOnUserRole=null;
_displayValueOnly=null;
_displayValueOnlyStyle=null;
_displayValueOnlyStyleClass=null;
}
protected void setProperties(UIComponent component)
{
super.setProperties(component);
setBooleanProperty(component, JSFAttr.ESCAPE_ATTR, _escape);
setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
setBooleanProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_ATTR, _displayValueOnly);
setStringProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_STYLE_ATTR, _displayValueOnlyStyle);
setStringProperty(component, DisplayValueOnlyCapable.DISPLAY_VALUE_ONLY_STYLE_CLASS_ATTR, _displayValueOnlyStyleClass);
}
public void setEscape(String escape)
{
_escape = escape;
}
public void setEnabledOnUserRole(String enabledOnUserRole)
{
_enabledOnUserRole = enabledOnUserRole;
}
public void setVisibleOnUserRole(String visibleOnUserRole)
{
_visibleOnUserRole = visibleOnUserRole;
}
public void setDisplayValueOnly(String displayValueOnly)
{
_displayValueOnly = displayValueOnly;
}
public void setDisplayValueOnlyStyle(String displayValueOnlyStyle)
{
_displayValueOnlyStyle = displayValueOnlyStyle;
}
public void setDisplayValueOnlyStyleClass(String displayValueOnlyStyleClass)
{
_displayValueOnlyStyleClass = displayValueOnlyStyleClass;
}
} | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/util/StreamingAddResource.java | 797 |
| org/apache/myfaces/renderkit/html/util/NonBufferingAddResource.java | 514 |
}
private Class getClass(String className) throws ClassNotFoundException
{
Class clazz = ClassUtils.classForName(className);
validateResourceLoader(clazz);
return clazz;
}
public void serveResource(ServletContext context, HttpServletRequest request,
HttpServletResponse response) throws IOException
{
String pathInfo = request.getPathInfo();
String uri = request.getContextPath() + request.getServletPath()
+ (pathInfo == null ? "" : pathInfo);
String classNameStartsAfter = getResourceVirtualPath(context) + '/';
int posStartClassName = uri.indexOf(classNameStartsAfter) + classNameStartsAfter.length();
int posEndClassName = uri.indexOf(PATH_SEPARATOR, posStartClassName);
String className = uri.substring(posStartClassName, posEndClassName);
int posEndCacheKey = uri.indexOf(PATH_SEPARATOR, posEndClassName + 1);
String resourceUri = null;
if (posEndCacheKey + 1 < uri.length())
{
resourceUri = uri.substring(posEndCacheKey + 1);
}
try
{
Class resourceLoader = getClass(className);
validateResourceLoader(resourceLoader);
((ResourceLoader) resourceLoader.newInstance()).serveResource(context, request,
response, resourceUri);
// Do not call response.flushBuffer buffer here. There is no point, as if there
// ever were header data to write, this would fail as we have already written
// the response body. The only point would be to flush the output stream, but
// that will happen anyway when the servlet container closes the socket.
//
// In addition, flushing could fail here; it appears that Microsoft IE
// hasthe habit of hard-closing its socket as soon as it has received a complete
// gif file, rather than letting the server close it. The container will hopefully
// silently ignore exceptions on close.
}
catch (ResourceLoader.ClosedSocketException e) | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java | 799 |
| org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java | 1325 |
writer.endElement(HTML.TR_ELEM);
writer.endElement(HTML.TABLE_ELEM);
writer.startElement(HTML.DIV_ELEM,editor);
writer.writeAttribute(HTML.CLASS_ATTR,"kupu-dialogbuttons",null);
writer.startElement(HTML.BUTTON_ELEM,editor);
writer.writeAttribute(HTML.CLASS_ATTR,"kupu-dialog-button",null);
writer.writeAttribute(HTML.TYPE_ATTR,"button",null);
writer.writeAttribute(HTML.ONCLICK_ATTR,"drawertool.current_drawer.save()",null);
writer.writeAttribute(I18N_TRANSLATE_ATTR,"button_ok",null);
writer.write("Ok");
writer.endElement(HTML.BUTTON_ELEM);
writer.startElement(HTML.BUTTON_ELEM,editor);
writer.writeAttribute(HTML.CLASS_ATTR,"kupu-dialog-button",null);
writer.writeAttribute(HTML.TYPE_ATTR,"button",null);
writer.writeAttribute(HTML.ONCLICK_ATTR,"drawertool.closeDrawer()",null);
writer.writeAttribute(I18N_TRANSLATE_ATTR,"button_cancel",null);
writer.write("Cancel");
writer.endElement(HTML.BUTTON_ELEM);
writer.endElement(HTML.DIV_ELEM);
writer.endElement(HTML.DIV_ELEM);
writer.endElement(HTML.DIV_ELEM);
writer.endElement(HTML.DIV_ELEM); // toolbar | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/aliasbean/AliasBean.java | 186 |
| org/apache/myfaces/custom/aliasbean/AliasBeansScope.java | 117 |
makeAliases(context);
Map facetMap = null;
for (Iterator it = getFacets().entrySet().iterator(); it.hasNext();)
{
Map.Entry entry = (Map.Entry) it.next();
if (facetMap == null)
facetMap = new HashMap();
UIComponent component = (UIComponent) entry.getValue();
if (!component.isTransient())
{
facetMap.put(entry.getKey(), component.processSaveState(context));
}
}
List childrenList = null;
if (getChildCount() > 0)
{
for (Iterator it = getChildren().iterator(); it.hasNext();)
{
UIComponent child = (UIComponent) it.next();
if (!child.isTransient())
{
if (childrenList == null)
childrenList = new ArrayList(getChildCount());
childrenList.add(child.processSaveState(context));
}
}
} | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/util/StreamingAddResource.java | 407 |
| org/apache/myfaces/renderkit/html/util/DefaultAddResource.java | 99 |
}
// Methods to add resources
/**
* Adds the given Javascript resource to the document header at the specified
* document positioy by supplying a resourcehandler instance.
* <p/>
* Use this method to have full control about building the reference url
* to identify the resource and to customize how the resource is
* written to the response. In most cases, however, one of the convenience
* methods on this class can be used without requiring a custom ResourceHandler
* to be provided.
* <p/>
* If the script has already been referenced, it's added only once.
* <p/>
* Note that this method <i>queues</i> the javascript for insertion, and that
* the script is inserted into the buffered response by the ExtensionsFilter
* after the page is complete.
*/
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position,
ResourceHandler resourceHandler)
{
addJavaScriptAtPosition(context, position, resourceHandler, false);
}
/**
* Insert a [script src="url"] entry into the document header at the
* specified document position. If the script has already been
* referenced, it's added only once.
* <p/>
* The resource is expected to be in the classpath, at the same location as the
* specified component + "/resource".
* <p/>
* Example: when customComponent is class example.Widget, and
* resourceName is script.js, the resource will be retrieved from
* "example/Widget/resource/script.js" in the classpath.
*/
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position,
Class myfacesCustomComponent, String resourceName)
{
addJavaScriptAtPosition(context, position, new MyFacesResourceHandler(
myfacesCustomComponent, resourceName));
}
public void addJavaScriptAtPositionPlain(FacesContext context, ResourcePosition position, Class myfacesCustomComponent, String resourceName)
{
addJavaScriptAtPosition(context, position,
new MyFacesResourceHandler(myfacesCustomComponent, resourceName),
false, false);
}
/**
* Insert a [script src="url"] entry into the document header at the
* specified document position. If the script has already been
* referenced, it's added only once.
*
* @param defer specifies whether the html attribute "defer" is set on the
* generated script tag. If this is true then the browser will continue
* processing the html page without waiting for the specified script to
* load and be run.
*/
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position,
Class myfacesCustomComponent, String resourceName, boolean defer)
{
addJavaScriptAtPosition(context, position, new MyFacesResourceHandler(
myfacesCustomComponent, resourceName), defer);
}
/**
* Insert a [script src="url"] entry into the document header at the
* specified document position. If the script has already been
* referenced, it's added only once.
*
* @param uri is the location of the desired resource, relative to the base
* directory of the webapp (ie its contextPath).
*/
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position, String uri)
{
addJavaScriptAtPosition(context, position, uri, false);
}
/**
* Adds the given Javascript resource at the specified document position.
* If the script has already been referenced, it's added only once.
*/
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position, String uri,
boolean defer)
{ | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/layout/HtmlLayoutRenderer.java | 95 |
| org/apache/myfaces/custom/layout/HtmlLayoutRenderer.java | 146 |
protected void renderNavRight(FacesContext facesContext, HtmlPanelLayout panelLayout)
throws IOException
{
ResponseWriter writer = facesContext.getResponseWriter();
UIComponent header = panelLayout.getHeader();
UIComponent navigation = panelLayout.getNavigation();
UIComponent body = panelLayout.getBody();
UIComponent footer = panelLayout.getFooter();
writer.startElement(HTML.TABLE_ELEM, panelLayout);
HtmlRendererUtils.writeIdIfNecessary(writer, panelLayout, facesContext);
HtmlRendererUtils.renderHTMLAttributes(writer, panelLayout, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
if (header != null)
{
writer.startElement(HTML.TR_ELEM, panelLayout);
renderTableCell(facesContext, writer, header,
(navigation != null && body != null) ? 2 : 1,
panelLayout.getHeaderClass(),
panelLayout.getHeaderStyle());
writer.endElement(HTML.TR_ELEM);
}
if (navigation != null || body != null)
{
writer.startElement(HTML.TR_ELEM, panelLayout);
if (body != null) | |
| File | Line |
|---|---|
| org/apache/myfaces/webapp/filter/portlet/PortletExternalContextWrapper.java | 72 |
| org/apache/myfaces/webapp/filter/servlet/ServletExternalContextWrapper.java | 79 |
this._servletResponse = response;
this._multipartContent = multipartContent;
}
public void dispatch(String path) throws IOException {
_delegate.dispatch(path);
}
public String encodeActionURL(String url) {
return _delegate.encodeActionURL(url);
}
public String encodeNamespace(String name) {
return _delegate.encodeNamespace(name);
}
public String encodeResourceURL(String url) {
return _delegate.encodeResourceURL(url);
}
public Map getApplicationMap() {
return _delegate.getApplicationMap();
}
public String getAuthType() {
return _delegate.getAuthType();
}
public Object getContext() {
return _delegate.getContext();
}
public String getInitParameter(String name) {
return _delegate.getInitParameter(name);
}
public Map getInitParameterMap() {
return _delegate.getInitParameterMap();
}
public String getRemoteUser() {
return _delegate.getRemoteUser();
}
public Object getRequest() {
// Why is this done?
return _servletRequest==null?_delegate.getRequest():_servletRequest; | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/navigation/HtmlNavigationRenderer.java | 169 |
| org/apache/myfaces/custom/navmenu/htmlnavmenu/HtmlNavigationMenuRendererUtils.java | 162 |
renderChildrenTableLayout(facesContext, writer, panelNav, child.getChildren(), level + 1);
}
}
else {
//separator
HtmlRendererUtils.writePrettyLineSeparator(facesContext);
String style = panelNav.getSeparatorStyle();
String styleClass = panelNav.getSeparatorClass();
writer.startElement(HTML.TR_ELEM, panelNav);
writer.startElement(HTML.TD_ELEM, panelNav);
writeStyleAttributes(writer, style, styleClass);
if (style != null || styleClass != null) {
writer.startElement(HTML.SPAN_ELEM, panelNav);
writeStyleAttributes(writer, style, styleClass);
}
indent(writer, level);
RendererUtils.renderChild(facesContext, child);
if (style != null || styleClass != null) {
writer.endElement(HTML.SPAN_ELEM);
}
writer.endElement(HTML.TD_ELEM);
writer.endElement(HTML.TR_ELEM);
}
}
} | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/util/StreamingAddResource.java | 1102 |
| org/apache/myfaces/renderkit/html/util/DefaultAddResource.java | 665 |
writeJavaScriptReference(response, writer, this.getResourceUri(),_encode,_defer);
}
}
private abstract class InlinePositionedInfo implements WritablePositionedInfo
{
private final String _inlineValue;
protected InlinePositionedInfo(String inlineValue)
{
_inlineValue = inlineValue;
}
public String getInlineValue()
{
return _inlineValue;
}
public int hashCode()
{
return new HashCodeBuilder().append(_inlineValue).toHashCode();
}
public boolean equals(Object obj)
{
if (obj == null)
{
return false;
}
if (obj == this)
{
return true;
}
if (obj instanceof InlinePositionedInfo)
{
InlinePositionedInfo other = (InlinePositionedInfo) obj;
return new EqualsBuilder().append(_inlineValue, other._inlineValue).isEquals();
}
return false;
}
}
private class InlineScriptPositionedInfo extends InlinePositionedInfo
{
protected InlineScriptPositionedInfo(String inlineScript)
{
super(inlineScript);
}
public void writePositionedInfo(HttpServletResponse response, ResponseWriter writer)
throws IOException
{ | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/HtmlDataTableHack.java | 476 |
| org/apache/myfaces/custom/crosstable/UIColumns.java | 273 |
_dataModelMap.put(clientID, dataModel);
}
/**
* Creates a new DataModel around the current value.
*/
protected DataModel createDataModel() {
Object value = getValue();
if (value == null) {
return EMPTY_DATA_MODEL;
} else if (value instanceof DataModel) {
return (DataModel) value;
} else if (value instanceof List) {
return new ListDataModel((List) value);
} else if (value instanceof Collection) {
return new ListDataModel(new ArrayList((Collection) value));
} else if (OBJECT_ARRAY_CLASS.isAssignableFrom(value.getClass())) {
return new ArrayDataModel((Object[]) value);
} else if (value instanceof ResultSet) {
return new ResultSetDataModel((ResultSet) value);
} else if (value instanceof Result) {
return new ResultDataModel((Result) value);
} else {
return new ScalarDataModel(value);
}
} | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/AbstractHtmlPanelGroup.java | 56 |
| org/apache/myfaces/custom/datascroller/AbstractHtmlDataScroller.java | 107 |
public String getClientId(FacesContext context)
{
String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
if (clientId == null)
{
clientId = super.getClientId(context);
}
return clientId;
}
public boolean isRendered()
{
if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
return super.isRendered();
}
public boolean isSetDisplayValueOnly(){
return getDisplayValueOnly() != null ? true : false;
}
public boolean isDisplayValueOnly(){
return getDisplayValueOnly() != null ? getDisplayValueOnly().booleanValue() : false;
}
public void setDisplayValueOnly(boolean displayValueOnly){
this.setDisplayValueOnly((Boolean) Boolean.valueOf(displayValueOnly));
}
/**
* The layout this scroller should render with. Default is 'table',
* 'list' is implemented as well. Additionally you can use
* 'singleList' - then the data-scroller will render a list, but
* not the paginator - same with the value 'singleTable'.
*
* @JSFProperty
* defaultValue = "table"
*/
public abstract String getLayout();
/**
* standard html colspan attribute for table cell
*
* @JSFProperty
* defaultValue = "Integer.MIN_VALUE"
*/
public abstract int getColspan(); | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/util/StreamingAddResource.java | 364 |
| org/apache/myfaces/renderkit/html/util/NonBufferingAddResource.java | 184 |
writeJavaScriptReference(context, getResourceUri(context, resourceHandler), true, false);
}
public void addResourceHere(FacesContext context, ResourceHandler resourceHandler)
throws IOException
{
validateResourceHandler(resourceHandler);
String path = getResourceUri(context, resourceHandler);
ResponseWriter writer = context.getResponseWriter();
writer.write(context.getExternalContext().encodeResourceURL(path));
}
/**
* Verify that the resource handler is acceptable. Null is not
* valid, and the getResourceLoaderClass method must return a
* Class object whose instances implements the ResourceLoader
* interface.
*
* @param resourceHandler handler to check
*/
protected void validateResourceHandler(ResourceHandler resourceHandler)
{
if (resourceHandler == null)
{
throw new IllegalArgumentException("ResourceHandler is null");
}
validateResourceLoader(resourceHandler.getResourceLoaderClass());
}
/**
* Given a Class object, verify that the instances of that class
* implement the ResourceLoader interface.
*
* @param resourceloader loader to check
*/
protected void validateResourceLoader(Class resourceloader)
{
if (!ResourceLoader.class.isAssignableFrom(resourceloader))
{
throw new FacesException("Class " + resourceloader.getName() + " must implement "
+ ResourceLoader.class.getName());
}
}
public void addJavaScriptAtPosition(FacesContext context, ResourcePosition position, ResourceHandler resourceHandler) { | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/AbstractHtmlSelectManyMenu.java | 53 |
| org/apache/myfaces/component/html/ext/AbstractHtmlSelectOneMenu.java | 53 |
public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.Menu";
public String getClientId(FacesContext context)
{
String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
if (clientId == null)
{
clientId = super.getClientId(context);
}
return clientId;
}
public boolean isRendered()
{
if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
return super.isRendered();
}
public boolean isSetDisplayValueOnly(){
return getDisplayValueOnly() != null ? true : false;
}
public boolean isDisplayValueOnly(){
return getDisplayValueOnly() != null ? getDisplayValueOnly().booleanValue() : false;
}
public void setDisplayValueOnly(boolean displayValueOnly){
this.setDisplayValueOnly((Boolean) Boolean.valueOf(displayValueOnly));
}
} | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/AbstractHtmlSelectManyListbox.java | 52 |
| org/apache/myfaces/component/html/ext/AbstractHtmlSelectOneListbox.java | 53 |
public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.Listbox";
public String getClientId(FacesContext context)
{
String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
if (clientId == null)
{
clientId = super.getClientId(context);
}
return clientId;
}
public boolean isRendered()
{
if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
return super.isRendered();
}
public boolean isSetDisplayValueOnly(){
return getDisplayValueOnly() != null ? true : false;
}
public boolean isDisplayValueOnly(){
return getDisplayValueOnly() != null ? getDisplayValueOnly().booleanValue() : false;
}
public void setDisplayValueOnly(boolean displayValueOnly){
this.setDisplayValueOnly((Boolean) Boolean.valueOf(displayValueOnly));
}
} | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java | 1089 |
| org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java | 1111 |
String[] localeMonths = symbols.getShortMonths();
months[0] = localeMonths[Calendar.JANUARY];
months[1] = localeMonths[Calendar.FEBRUARY];
months[2] = localeMonths[Calendar.MARCH];
months[3] = localeMonths[Calendar.APRIL];
months[4] = localeMonths[Calendar.MAY];
months[5] = localeMonths[Calendar.JUNE];
months[6] = localeMonths[Calendar.JULY];
months[7] = localeMonths[Calendar.AUGUST];
months[8] = localeMonths[Calendar.SEPTEMBER];
months[9] = localeMonths[Calendar.OCTOBER];
months[10] = localeMonths[Calendar.NOVEMBER];
months[11] = localeMonths[Calendar.DECEMBER];
return months;
}
public void decode(FacesContext facesContext, UIComponent component) | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/AbstractHtmlSelectBooleanCheckbox.java | 54 |
| org/apache/myfaces/component/html/ext/AbstractHtmlSelectManyCheckbox.java | 59 |
public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.Checkbox";
public String getClientId(FacesContext context)
{
String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
if (clientId == null)
{
clientId = super.getClientId(context);
}
return clientId;
}
public boolean isRendered()
{
if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
return super.isRendered();
}
public boolean isSetDisplayValueOnly(){
return getDisplayValueOnly() != null ? true : false;
}
public boolean isDisplayValueOnly(){
return getDisplayValueOnly() != null ? getDisplayValueOnly().booleanValue() : false;
}
public void setDisplayValueOnly(boolean displayValueOnly){
this.setDisplayValueOnly((Boolean) Boolean.valueOf(displayValueOnly));
} | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/AbstractHtmlInputTextarea.java | 52 |
| org/apache/myfaces/custom/datascroller/AbstractHtmlDataScroller.java | 107 |
public String getClientId(FacesContext context)
{
String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
if (clientId == null)
{
clientId = super.getClientId(context);
}
return clientId;
}
public boolean isRendered()
{
if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
return super.isRendered();
}
public boolean isSetDisplayValueOnly(){
return getDisplayValueOnly() != null ? true : false;
}
public boolean isDisplayValueOnly(){
return getDisplayValueOnly() != null ? getDisplayValueOnly().booleanValue() : false;
}
public void setDisplayValueOnly(boolean displayValueOnly){
this.setDisplayValueOnly((Boolean) Boolean.valueOf(displayValueOnly));
}
/**
* A integer representing the number of checkbox rows if the
* layout is lineDirection and checkbox columns if the layout
* is pageDirection.
*
* @JSFProperty
*/
public abstract String getLayoutWidth(); | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/AbstractHtmlInputText.java | 53 |
| org/apache/myfaces/component/html/ext/AbstractHtmlInputTextarea.java | 52 |
public String getClientId(FacesContext context)
{
String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
if (clientId == null)
{
clientId = super.getClientId(context);
}
return clientId;
}
public boolean isRendered()
{
if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
return super.isRendered();
}
public boolean isSetDisplayValueOnly(){
return getDisplayValueOnly() != null ? true : false;
}
public boolean isDisplayValueOnly(){
return getDisplayValueOnly() != null ? getDisplayValueOnly().booleanValue() : false;
}
public void setDisplayValueOnly(boolean displayValueOnly){
this.setDisplayValueOnly((Boolean) Boolean.valueOf(displayValueOnly));
}
/**
* None standard HTML attribute.
*
* Possible values are: soft, hard, virtual, physical and off.
*
* @JSFProperty
*/
public abstract String getWrap(); | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/AbstractHtmlInputSecret.java | 53 |
| org/apache/myfaces/component/html/ext/AbstractHtmlPanelGrid.java | 53 |
public String getClientId(FacesContext context)
{
String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
if (clientId == null)
{
clientId = super.getClientId(context);
}
return clientId;
}
public boolean isRendered()
{
if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
return super.isRendered();
}
public boolean isSetDisplayValueOnly(){
return getDisplayValueOnly() != null ? true : false;
}
public boolean isDisplayValueOnly(){
return getDisplayValueOnly() != null ? getDisplayValueOnly().booleanValue() : false;
}
public void setDisplayValueOnly(boolean displayValueOnly){
this.setDisplayValueOnly((Boolean) Boolean.valueOf(displayValueOnly));
}
} | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/AbstractHtmlInputSecret.java | 53 |
| org/apache/myfaces/component/html/ext/AbstractHtmlInputText.java | 53 |
public String getClientId(FacesContext context)
{
String clientId = HtmlComponentUtils.getClientId(this, getRenderer(context), context);
if (clientId == null)
{
clientId = super.getClientId(context);
}
return clientId;
}
public boolean isRendered()
{
if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;
return super.isRendered();
}
public boolean isSetDisplayValueOnly(){
return getDisplayValueOnly() != null ? true : false;
}
public boolean isDisplayValueOnly(){
return getDisplayValueOnly() != null ? getDisplayValueOnly().booleanValue() : false;
}
public void setDisplayValueOnly(boolean displayValueOnly){
this.setDisplayValueOnly((Boolean) Boolean.valueOf(displayValueOnly));
} | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/calendar/HtmlInputCalendarTagHandler.java | 44 |
| org/apache/myfaces/custom/date/HtmlInputDateTagHandler.java | 45 |
public HtmlInputDateTagHandler(ComponentConfig config)
{
super(config);
}
protected MetaRuleset createMetaRuleset(Class type)
{
MetaRuleset m = super.createMetaRuleset(type);
m.addRule(DateBusinessConverterRule.INSTANCE);
return m;
}
public static class DateBusinessConverterRule extends MetaRule
{
public final static DateBusinessConverterRule INSTANCE = new DateBusinessConverterRule();
final static class LiteralConverterMetadata extends Metadata
{
private final Class dateBusinessConverterClass;
public LiteralConverterMetadata(String dateBusinessConverterClass)
{
try
{
this.dateBusinessConverterClass = ClassUtils
.classForName(dateBusinessConverterClass);
}
catch(ClassNotFoundException e)
{
throw new IllegalArgumentException("Class referenced in calendarConverter not found: "+dateBusinessConverterClass);
}
catch(ClassCastException e)
{
throw new IllegalArgumentException("Class referenced in calendarConverter is not instance of org.apache.myfaces.custom.calendar.CalendarConverter: "+dateBusinessConverterClass);
}
}
public void applyMetadata(FaceletContext ctx, Object instance)
{
((AbstractHtmlInputDate) instance) | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/navigation/HtmlNavigationRenderer.java | 145 |
| org/apache/myfaces/custom/navmenu/htmlnavmenu/HtmlNavigationMenuRendererUtils.java | 140 |
String styleClass = getNavigationItemClass(panelNav, (HtmlCommandNavigationItem) child);
writer.startElement(HTML.TR_ELEM, panelNav);
writer.startElement(HTML.TD_ELEM, panelNav);
writeStyleAttributes(writer, style, styleClass);
if (style != null || styleClass != null) {
writer.startElement(HTML.SPAN_ELEM, panelNav);
writeStyleAttributes(writer, style, styleClass);
}
indent(writer, level);
child.encodeBegin(facesContext);
child.encodeEnd(facesContext);
if (style != null || styleClass != null) {
writer.endElement(HTML.SPAN_ELEM);
}
writer.endElement(HTML.TD_ELEM);
writer.endElement(HTML.TR_ELEM);
if (child.getChildCount() > 0) { | |
| File | Line |
|---|---|
| org/apache/myfaces/webapp/filter/MultipartRequestWrapper.java | 215 |
| org/apache/myfaces/webapp/filter/PortletMultipartRequestWrapper.java | 239 |
}
}
private void addTextParameter(String name, String value){
if( ! parametersMap.containsKey( name ) ){
String[] valuesArray = {value};
parametersMap.put(name, valuesArray);
}else{
String[] storedValues = (String[])parametersMap.get( name );
int lengthSrc = storedValues.length;
String[] valuesArray = new String[lengthSrc+1];
System.arraycopy(storedValues, 0, valuesArray, 0, lengthSrc);
valuesArray[lengthSrc] = value;
parametersMap.put(name, valuesArray);
}
}
public Enumeration getParameterNames() {
if( parametersMap == null ) parseRequest(); | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/HtmlDataTableHack.java | 335 |
| org/apache/myfaces/custom/crosstable/UIColumns.java | 184 |
protected void restoreDescendantComponentStates(Iterator childIterator, Object state) {
Iterator descendantStateIterator = null;
while (childIterator.hasNext()) {
if (descendantStateIterator == null && state != null) {
descendantStateIterator = ((Collection) state).iterator();
}
UIComponent component = (UIComponent) childIterator.next();
// reset the client id (see spec 3.1.6)
component.setId(component.getId());
if (!component.isTransient()) {
Object childState = null;
Object descendantState = null;
if (descendantStateIterator != null && descendantStateIterator.hasNext()) {
Object[] object = (Object[]) descendantStateIterator.next();
childState = object[0];
descendantState = object[1];
}
if (component instanceof EditableValueHolder) { | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/BaseSortableModel.java | 276 |
| org/apache/myfaces/component/html/ext/HtmlDataTableHack.java | 539 |
}
private static final DataModel EMPTY_DATA_MODEL = new _SerializableDataModel()
{
public boolean isRowAvailable()
{
return false;
}
public int getRowCount()
{
return 0;
}
public Object getRowData()
{
throw new IllegalArgumentException();
}
public int getRowIndex()
{
return -1;
}
public void setRowIndex(int i)
{
if (i < -1)
throw new IndexOutOfBoundsException("Index < 0 : " + i);
}
public Object getWrappedData()
{
return null;
}
public void setWrappedData(Object obj)
{
if (obj == null)
return; //Clearing is allowed
throw new UnsupportedOperationException(this.getClass().getName()
+ " UnsupportedOperationException");
}
}; | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java | 910 |
| org/apache/myfaces/custom/inputHtml/InputHtmlRenderer.java | 935 |
writer.endElement(HTML.LABEL_ATTR);
writer.endElement(HTML.TD_ELEM);
writer.endElement(HTML.TR_ELEM);
writer.startElement(HTML.TR_ELEM, editor);
writer.startElement(HTML.TH_ELEM,editor);
writer.writeAttribute(HTML.CLASS_ATTR, "kupu-toolbox-label", null);
writer.writeAttribute(HTML.COLSPAN_ATTR,"1",null);
writer.writeAttribute(ROWSPAN_ATTR,"1",null);
writer.endElement(HTML.TH_ELEM);
writer.startElement(HTML.TD_ELEM, editor);
writer.writeAttribute(HTML.COLSPAN_ATTR,"1",null);
writer.writeAttribute(ROWSPAN_ATTR,"1",null);
writer.startElement(HTML.BUTTON_ELEM, editor); | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/schedule/ScheduleCompactMonthRenderer.java | 59 |
| org/apache/myfaces/custom/schedule/ScheduleCompactWeekRenderer.java | 56 |
public void encodeBegin(
FacesContext context,
UIComponent component
)
throws IOException
{
if (!component.isRendered()) {
return;
}
super.encodeBegin(context, component);
HtmlSchedule schedule = (HtmlSchedule) component;
ResponseWriter writer = context.getResponseWriter();
//container div for the schedule grid
writer.startElement(HTML.DIV_ELEM, schedule);
writer.writeAttribute(HTML.CLASS_ATTR, "schedule-compact-" + schedule.getTheme(), null);
writer.writeAttribute(
HTML.STYLE_ATTR, "border-style: none; overflow: hidden;", null
);
writer.startElement(HTML.TABLE_ELEM, schedule);
writer.writeAttribute(HTML.CLASS_ATTR, getStyleClass(schedule, "week"), null); | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/util/StreamingAddResource.java | 972 |
| org/apache/myfaces/renderkit/html/util/DefaultAddResource.java | 563 |
public abstract void writePositionedInfo(HttpServletResponse response, ResponseWriter writer)
throws IOException;
}
private abstract class AbstractResourceUri
{
protected final String _resourceUri;
protected AbstractResourceUri(String resourceUri)
{
_resourceUri = resourceUri;
}
public int hashCode()
{
return _resourceUri.hashCode();
}
public boolean equals(Object obj)
{
if (obj == null)
{
return false;
}
if (obj == this)
{
return true;
}
if (obj instanceof AbstractResourceUri)
{
AbstractResourceUri other = (AbstractResourceUri) obj;
return _resourceUri.equals(other._resourceUri);
}
return false;
}
protected String getResourceUri()
{
return _resourceUri;
}
}
private class StylePositionedInfo extends AbstractResourceUri implements WritablePositionedInfo | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java | 1248 |
| org/apache/myfaces/custom/calendar/HtmlCalendarRenderer.java | 1309 |
if(uiComponent instanceof HtmlInputCalendar && ((HtmlInputCalendar) uiComponent).isRenderAsPopup())
{
HtmlInputCalendar calendar = (HtmlInputCalendar) uiComponent;
String popupDateFormat = calendar.getPopupDateFormat();
String formatStr = createJSPopupFormat(facesContext, popupDateFormat);
Locale locale = facesContext.getViewRoot().getLocale();
Calendar timeKeeper = Calendar.getInstance(locale);
int firstDayOfWeek = timeKeeper.getFirstDayOfWeek() - 1;
org.apache.myfaces.dateformat.DateFormatSymbols symbols = new org.apache.myfaces.dateformat.DateFormatSymbols(locale);
SimpleDateFormatter dateFormat = new SimpleDateFormatter(formatStr, symbols, firstDayOfWeek); | |
| File | Line |
|---|---|
| org/apache/myfaces/component/html/ext/BaseSortableModel.java | 278 |
| org/apache/myfaces/custom/crosstable/UIColumns.java | 300 |
private static final DataModel EMPTY_DATA_MODEL = new DataModel() {
public boolean isRowAvailable() {
return false;
}
public int getRowCount() {
return 0;
}
public Object getRowData() {
throw new IllegalArgumentException();
}
public int getRowIndex() {
return -1;
}
public void setRowIndex(int i) {
if (i < -1)
throw new IndexOutOfBoundsException("Index < 0 : " + i);
}
public Object getWrappedData() {
return null;
}
public void setWrappedData(Object obj) {
if (obj == null)
return; //Clearing is allowed
throw new UnsupportedOperationException(this.getClass().getName() + " UnsupportedOperationException");
}
}; | |
| File | Line |
|---|---|
| org/apache/myfaces/webapp/filter/MultipartRequestWrapper.java | 97 |
| org/apache/myfaces/webapp/filter/PortletMultipartRequestWrapper.java | 97 |
fileUpload = new PortletFileUpload();
}
fileUpload.setSizeMax(maxSize);
fileUpload.setFileSizeMax(maxFileSize);
//fileUpload.setSizeThreshold(thresholdSize);
if(repositoryPath != null && repositoryPath.trim().length()>0)
{
//fileUpload.setRepositoryPath(repositoryPath);
fileUpload.setFileItemFactory(
new DiskFileItemFactory(thresholdSize,
new File(repositoryPath)));
}
else
{
fileUpload.setFileItemFactory(
new DiskFileItemFactory(thresholdSize,
new File(System.getProperty("java.io.tmpdir"))));
}
String charset = request.getCharacterEncoding();
fileUpload.setHeaderEncoding(charset);
List requestParameters = null;
try
{
if (cacheFileSizeErrors)
{
requestParameters = ((PortletChacheFileSizeErrorsFileUpload) fileUpload). | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/layout/HtmlLayoutRenderer.java | 113 |
| org/apache/myfaces/custom/layout/HtmlLayoutRenderer.java | 215 |
panelLayout.getFooterStyle());
writer.endElement(HTML.TR_ELEM);
}
if (navigation != null || body != null)
{
writer.startElement(HTML.TR_ELEM, panelLayout);
if (navigation != null)
{
renderTableCell(facesContext, writer, navigation, 0,
panelLayout.getNavigationClass(),
panelLayout.getNavigationStyle());
}
if (body != null)
{
renderTableCell(facesContext, writer, body, 0,
panelLayout.getBodyClass(),
panelLayout.getBodyStyle());
}
writer.endElement(HTML.TR_ELEM);
}
if (header != null) | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/calendar/HtmlInputCalendarTagHandler.java | 86 |
| org/apache/myfaces/custom/date/HtmlInputDateTagHandler.java | 87 |
((AbstractHtmlInputDate) instance)
.setDateBusinessConverter((DateBusinessConverter) ClassUtils
.newInstance(dateBusinessConverterClass));
}
}
final static class DynamicConverterMetadata extends Metadata
{
private final TagAttribute attr;
public DynamicConverterMetadata(TagAttribute attr)
{
this.attr = attr;
}
public void applyMetadata(FaceletContext ctx, Object instance)
{
((UIComponent) instance).setValueBinding("dateBusinessConverter",
new LegacyValueBinding(attr.getValueExpression(ctx,
DateBusinessConverter.class)));
}
}
public Metadata applyRule(String name, TagAttribute attribute,
MetadataTarget meta)
{
if (meta.isTargetInstanceOf(AbstractHtmlInputDate.class)) | |
| File | Line |
|---|---|
| org/apache/myfaces/custom/calendar/AbstractHtmlInputCalendarTag.java | 57 |
| org/apache/myfaces/custom/date/AbstractHtmlInputDateTag.java | 60 |
(org.apache.myfaces.custom.date.AbstractHtmlInputDate) component;
if (_dateBusinessConverter != null)
{
if (isValueReference(_dateBusinessConverter))
{
ValueBinding vb = context.getApplication().createValueBinding(_dateBusinessConverter);
comp.setValueBinding("dateBusinessConverter", vb);
}
else
{
try
{
Class clazz = ClassUtils.classForName(_dateBusinessConverter);
comp.setDateBusinessConverter( (DateBusinessConverter) ClassUtils.newInstance(clazz));
}
catch(ClassNotFoundException e)
{
throw new IllegalArgumentException("Class referenced in calendarConverter not found: "+_dateBusinessConverter);
}
catch(ClassCastException e)
{
throw new IllegalArgumentException("Class referenced in calendarConverter is not instance of org.apache.myfaces.custom.calendar.CalendarConverter: "+_dateBusinessConverter);
}
}
}
}
} | |