Author: dolander
Date: Thu Oct 28 08:35:24 2004
New Revision: 55867
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObjectException.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ProcessPopulate.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/DOMUtils.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/DefaultURLRewriter.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/PageflowTagUtils.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/TemplateHelper.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/PagerModel.java
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/util/JspUtil.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/IScriptReporter.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Html.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageAnchor.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/JavaScriptUtils.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Parameter.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptContainer.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/javaScript.properties
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/HtmlExceptionFormatter.java
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/type/TypeUtils.java
Log:
Performance work in the Anchor Tag.
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/AutoRegisterActionServlet.java
Thu Oct 28 08:35:24 2004
@@ -495,7 +495,7 @@
if ( _log.isInfoEnabled() )
{
- StringBuffer msg = new StringBuffer( "Dynamically registering
module " ).append( modulePath );
+ StringBuilder msg = new StringBuilder( "Dynamically registering
module " ).append( modulePath );
_log.info( msg.append( ", config XML " ).append( configFilePath
).toString() );
}
@@ -602,7 +602,7 @@
if ( _log.isErrorEnabled() )
{
- StringBuffer msg = new StringBuffer( "No module
configuration registered for " );
+ StringBuilder msg = new StringBuilder( "No module
configuration registered for " );
msg.append( uri ).append( " (module path " ).append(
modulePath ).append( ")." );
_log.error( msg.toString() );
}
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
Thu Oct 28 08:35:24 2004
@@ -754,7 +754,7 @@
if ( _log.isWarnEnabled() )
{
- StringBuffer msg = new StringBuffer( "Could not find matching
action method for action=" );
+ StringBuilder msg = new StringBuilder( "Could not find matching
action method for action=" );
msg.append( actionName ).append( ", form=" );
msg.append( inputForm != null ? inputForm.getClass().getName()
:"[none]" );
_log.warn( msg.toString() );
@@ -765,7 +765,7 @@
private static String getFormQualifiedActionPath( Class formClass, String
actionPath )
{
- StringBuffer ret = new StringBuffer( actionPath );
+ StringBuilder ret = new StringBuilder( actionPath );
ret.append( '_' );
ret.append( formClass.getName().replace( '.', '_' ).replace( '$', '_'
) );
return ret.toString();
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/Forward.java
Thu Oct 28 08:35:24 2004
@@ -96,7 +96,7 @@
private transient FlowController _flowController = null; // will be
reinitialized as necessary by PreviousPageInfo
private transient ServletContext _servletContext = null; // will be
reinitialized as necessary by PreviousPageInfo
private String _mappingPath;
- private StringBuffer _queryString;
+ private StringBuilder _queryString;
private boolean _explicitPath = false;
private String _returnFormType = null;
private boolean _userSetRedirect = false;
@@ -802,11 +802,11 @@
}
else if ( queryString.startsWith( "?" ) )
{
- _queryString = new StringBuffer( queryString );
+ _queryString = new StringBuilder( queryString );
}
else
{
- _queryString = new StringBuffer( "?" ).append( queryString );
+ _queryString = new StringBuilder( "?" ).append( queryString );
}
}
@@ -831,7 +831,7 @@
{
if ( _queryString == null )
{
- _queryString = new StringBuffer( "?" );
+ _queryString = new StringBuilder( "?" );
}
else
{
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
Thu Oct 28 08:35:24 2004
@@ -383,7 +383,7 @@
if ( _log.isWarnEnabled() )
{
- StringBuffer msg = new StringBuffer( "Tried to pop from empty
PageFlow stack." );
+ StringBuilder msg = new StringBuilder( "Tried to pop from
empty PageFlow stack." );
msg.append( " Current page flow is " );
msg.append( curJpf != null ? curJpf.getClass().getName() :
null );
_log.warn( msg.append( '.' ).toString() );
@@ -447,7 +447,7 @@
_log.debug( "Action on popped PageFlowController is " + exitAction
);
}
- StringBuffer exitActionPath = new StringBuffer(
poppedPageFlow.getModulePath() );
+ StringBuilder exitActionPath = new StringBuilder(
poppedPageFlow.getModulePath() );
if ( exitAction.charAt( 0 ) != '/' )
{
exitActionPath.append( '/' );
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowActionServlet.java
Thu Oct 28 08:35:24 2004
@@ -66,7 +66,7 @@
{
public String getModuleConfigPath( String moduleName )
{
- StringBuffer moduleConfPath = new StringBuffer( getGenDir() );
+ StringBuilder moduleConfPath = new StringBuilder( getGenDir() );
moduleConfPath.append( '/' ).append(
PageFlowConstants.JPF_MODULE_CONFIG_PREFIX );
if ( moduleName.length() > 1 )
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowController.java
Thu Oct 28 08:35:24 2004
@@ -722,7 +722,7 @@
{
String className = getClass().getName();
int lastDot = className.lastIndexOf( '.' );
- StringBuffer ret = new StringBuffer( "/" );
+ StringBuilder ret = new StringBuilder( "/" );
return ret.append( className.substring( lastDot + 1 ) ).append(
JPF_EXTENSION ).toString();
}
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObjectException.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObjectException.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowManagedObjectException.java
Thu Oct 28 08:35:24 2004
@@ -122,7 +122,7 @@
public String getMessage()
{
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
String[] parts = getMessageParts();
Object[] args = getMessageArgs();
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowRequestProcessor.java
Thu Oct 28 08:35:24 2004
@@ -560,7 +560,8 @@
{
String actionPath = paramName.substring(
ACTION_OVERRIDE_PARAM_PREFIX_LEN );
- actionPath = PageflowTagUtils.createActionPath(
servletContext, request, actionPath );
+ String qualifiedAction =
PageflowTagUtils.qualifiedAction(servletContext,actionPath);
+ actionPath = PageflowTagUtils.createActionPath(request,
qualifiedAction );
if ( _log.isDebugEnabled() )
{
@@ -588,7 +589,7 @@
{
if ( _log.isErrorEnabled() )
{
- StringBuffer msg = new StringBuffer( "No module
configuration registered for " );
+ StringBuilder msg = new StringBuilder( "No module
configuration registered for " );
msg.append( uri ).append( " (module path " ).append(
modulePath ).append( ")." );
_log.error( msg.toString() );
}
@@ -620,7 +621,7 @@
if ( _log.isErrorEnabled() )
{
- StringBuffer msg = new StringBuffer( "Wrong .jpf
requested for this directory: got " );
+ StringBuilder msg = new StringBuilder( "Wrong .jpf
requested for this directory: got " );
msg.append( requestedType ).append( ", expected "
).append( desiredType ).append( '.' );
_log.error( msg.toString() );
}
@@ -1032,7 +1033,7 @@
{
if ( _log.isInfoEnabled() )
{
- StringBuffer msg = new StringBuffer( "Action \"" ).append(
actionPath );
+ StringBuilder msg = new StringBuilder( "Action \"" ).append(
actionPath );
_log.info( msg.append( "\" was also unhandled by Global.app."
).toString() );
}
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
Thu Oct 28 08:35:24 2004
@@ -150,7 +150,7 @@
public static String getBeginActionURI( String requestURI )
{
// Translate this to a request for the begin action ("begin.do") for
this PageFlowController.
- StringBuffer retVal = new StringBuffer();
+ StringBuilder retVal = new StringBuilder();
int lastSlash = requestURI.lastIndexOf( '/' );
if ( lastSlash != -1 )
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ProcessPopulate.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ProcessPopulate.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ProcessPopulate.java
Thu Oct 28 08:35:24 2004
@@ -86,7 +86,7 @@
public String toString()
{
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
buf.append("expression: " + expression + "\n");
if(values != null)
for(int i = 0; i < values.length; i++)
@@ -134,7 +134,7 @@
if(!handlerMap.containsKey(handler))
throw new
IllegalStateException(Bundle.getErrorString("ProcessPopulate_handler_notRegistered",
new Object[] {handler}));
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
buf.append(WLW_TAG_HANDLER_PREFIX);
buf.append(handler);
buf.append(WLW_TAG_HANDLER_SUFFIX);
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultExceptionsHandler.java
Thu Oct 28 08:35:24 2004
@@ -129,7 +129,7 @@
if ( _log.isErrorEnabled() )
{
- StringBuffer msg = new StringBuffer( "Throwable " ).append(
exClass.getName() );
+ StringBuilder msg = new StringBuilder( "Throwable " ).append(
exClass.getName() );
_log.error( msg.append( " unhandled by the current page flow (and
any shared flow)" ).toString(), ex );
}
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/DOMUtils.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/DOMUtils.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/DOMUtils.java
Thu Oct 28 08:35:24 2004
@@ -103,7 +103,7 @@
if(list.size() == 1) {
Element child = (Element) list.get(0);
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
NodeList children = child.getChildNodes();
for(int i = 0; i < children.getLength(); i++) {
@@ -131,7 +131,7 @@
*/
public static String getElementText(Element element)
{
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
NodeList children = element.getChildNodes();
for(int i = 0; i < children.getLength(); i++) {
@@ -164,7 +164,7 @@
for(int i = 0; i < children.size(); i++) {
Node child = (Node) children.get(i);
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder();
NodeList nodes = child.getChildNodes();
for(int j = 0; j < nodes.getLength(); j++) {
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/DefaultURLRewriter.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/DefaultURLRewriter.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/DefaultURLRewriter.java
Thu Oct 28 08:35:24 2004
@@ -97,7 +97,7 @@
else
{
//Need to build up the url
- StringBuffer urlBuf = new StringBuffer( protocol );
+ StringBuilder urlBuf = new StringBuilder( protocol );
urlBuf.append( "://" );
urlBuf.append( serverName );
urlBuf.append( ":" );
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/PageflowTagUtils.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/PageflowTagUtils.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/PageflowTagUtils.java
Thu Oct 28 08:35:24 2004
@@ -60,10 +60,11 @@
private static MessageResources messages =
MessageResources.getMessageResources("org.apache.struts.util.LocalStrings");
- public static String getRewrittenFormAction(String action, PageContext
pageContext)
+ public static String getRewrittenFormAction(HttpServletRequest request,
String action, PageContext pageContext)
{
HttpServletResponse response = (HttpServletResponse)
pageContext.getResponse();
- String actionUrl = createActionURL(pageContext, action);
+ String qualifiedAction =
PageflowTagUtils.qualifiedAction(pageContext.getServletContext(),action);
+ String actionUrl = createActionURL(request, qualifiedAction);
actionUrl = prepareActionUrl(pageContext, actionUrl);
@@ -116,13 +117,9 @@
return response.encodeURL(url);
}
- public static String createActionURL(PageContext pageContext, String
action)
+ public static String createActionURL(HttpServletRequest servletRequest,
String qualifiedAction)
{
- ServletContext servletContext = pageContext.getServletContext();
- HttpServletRequest servletRequest = (HttpServletRequest)
pageContext.getRequest();
-
- StringBuffer value = new StringBuffer();
-
+ StringBuilder value = new StringBuilder(qualifiedAction.length() + 16);
String pageURI = InternalUtils.decodeURI( servletRequest );
int lastSlash = pageURI.lastIndexOf( '/' );
@@ -130,68 +127,31 @@
{
value.append( pageURI.substring( 0, lastSlash ) );
}
- // Use our servlet mapping, if one is specified
- String servletMapping = (String)
- servletContext.getAttribute(Globals.SERVLET_KEY);
-
- if (servletMapping != null)
- {
- String queryString = null;
- int question = action.indexOf("?");
- if (question >= 0)
- {
- queryString = action.substring(question);
- }
- String actionMapping =
URLRewriterService.getActionMappingName(action);
- if (servletMapping.startsWith("*."))
- {
- value.append(actionMapping);
- value.append(servletMapping.substring(1));
- }
- else if (servletMapping.endsWith("/*"))
- {
- value.append(servletMapping.substring
- (0, servletMapping.length() - 2));
- value.append(actionMapping);
- }
- else if (servletMapping.equals("/"))
- {
- value.append(actionMapping);
- }
- if (queryString != null) {
- value.append(queryString);
- }
- }
-
- // Otherwise, assume extension mapping is in use and extension is
- // already included in the action property
- else
- {
- if (!action.startsWith("/"))
- {
- value.append("/");
- }
- value.append(action);
- }
+ value.append(qualifiedAction);
return value.toString();
}
- public static String createActionPath(ServletContext servletContext,
HttpServletRequest request, String action)
+ public static String createActionPath(HttpServletRequest request, String
qualifiedAction)
{
-
- StringBuffer value = new StringBuffer();
+ StringBuilder value = new StringBuilder(qualifiedAction.length() + 16);
ModuleConfig appConfig = (ModuleConfig)
request.getAttribute(Globals.MODULE_KEY);
if (appConfig != null)
{
value.append(appConfig.getPrefix());
}
+ value.append(qualifiedAction);
- // Use our servlet mapping, if one is specified
- String servletMapping = (String)
- servletContext.getAttribute(Globals.SERVLET_KEY);
+ return value.toString();
+ }
+
+ public static String qualifiedAction(ServletContext servletContext, String
action)
+ {
+ StringBuilder sb = new StringBuilder(32);
+ // Use our servlet mapping, if one is specified
+ String servletMapping = (String)
servletContext.getAttribute(Globals.SERVLET_KEY);
if (servletMapping != null)
{
String queryString = null;
@@ -203,21 +163,21 @@
String actionMapping =
URLRewriterService.getActionMappingName(action);
if (servletMapping.startsWith("*."))
{
- value.append(actionMapping);
- value.append(servletMapping.substring(1));
+ sb.append(actionMapping);
+ sb.append(servletMapping.substring(1));
}
else if (servletMapping.endsWith("/*"))
{
- value.append(servletMapping.substring
+ sb.append(servletMapping.substring
(0, servletMapping.length() - 2));
- value.append(actionMapping);
+ sb.append(actionMapping);
}
else if (servletMapping.equals("/"))
{
- value.append(actionMapping);
+ sb.append(actionMapping);
}
if (queryString != null) {
- value.append(queryString);
+ sb.append(queryString);
}
}
@@ -227,17 +187,11 @@
{
if (!action.startsWith("/"))
{
- value.append("/");
+ sb.append("/");
}
- value.append(action);
+ sb.append(action);
}
-
- return value.toString();
- }
-
- public static String getActionPath(PageContext pageContext, String action)
- {
- return createActionPath(pageContext.getServletContext(),
(HttpServletRequest) pageContext.getRequest(), action);
+ return sb.toString();
}
public static boolean isAction(HttpServletRequest request,
HttpServletResponse response, ServletContext servletContext, String action)
@@ -315,18 +269,19 @@
throw new
MalformedURLException(messages.getMessage("computeURL.specifier"));
}
+ HttpServletRequest request = (HttpServletRequest)
pageContext.getRequest();
+
// Look up the module configuration for this request
ModuleConfig config =
- (ModuleConfig)
pageContext.getRequest().getAttribute(Globals.MODULE_KEY);
+ (ModuleConfig) request.getAttribute(Globals.MODULE_KEY);
if (config == null) { // Backwards compatibility hack
config =
(ModuleConfig)
pageContext.getServletContext().getAttribute(Globals.MODULE_KEY);
- InternalUtils.setCurrentModule( config, pageContext.getRequest() );
+ InternalUtils.setCurrentModule( config, request );
}
// Calculate the appropriate URL
- StringBuffer url = new StringBuffer();
- HttpServletRequest request = (HttpServletRequest)
pageContext.getRequest();
+ StringBuilder url = new StringBuilder(32);
if (forward != null) {
ForwardConfig fc = config.findForwardConfig(forward);
if (fc == null) {
@@ -371,7 +326,7 @@
}
//
- public static void addParameters(StringBuffer url,String encoding,
+ public static void addParameters(StringBuilder url,String encoding,
boolean redirect,Map params)
{
String anchor;
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/TemplateHelper.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/TemplateHelper.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/util/TemplateHelper.java
Thu Oct 28 08:35:24 2004
@@ -504,7 +504,7 @@
return other;
}
- private static StringBuffer appendEnsureSeparator(StringBuffer buf, String
token)
+ private static StringBuilder appendEnsureSeparator(StringBuilder buf,
String token)
{
if(token != null && token.length() > 0) {
if(buf.charAt(buf.length() - 1) != '/' && token.charAt(0) != '/') {
@@ -539,7 +539,7 @@
private String toStringDefault()
{
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder(32);
// Append the server
buf.append(scheme).append("://");
@@ -635,7 +635,7 @@
_template = replace(_template, "{url:currentPage}", "");
// Path - this is reserved
- StringBuffer buf = new StringBuffer();
+ StringBuilder buf = new StringBuilder(32);
if(getPath() != null) {
// Append the webapp name
//String webAppName = ApplicationHelper.getWebAppName(httpRequest);
@@ -667,7 +667,7 @@
_template = replace(_template, "{url:path}", buf.toString());
// Query string - this is reserved
- buf = new StringBuffer();
+ buf = new StringBuilder(32);
if (queryString != null)
buf.append(queryString);
if(params != null && params.size() > 0) {
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/script/common/ImplicitObjectUtil.java
Thu Oct 28 08:35:24 2004
@@ -98,12 +98,13 @@
public static final ImplicitObjectBean getImplicitObjects(PageContext
pageContext, JspTag currentTag)
{
- ImplicitObjectBean bean =
(ImplicitObjectBean)pageContext.getRequest().getAttribute(IMPLICIT_OBJECT_BEAN);
+ ServletRequest request = pageContext.getRequest();
+ ImplicitObjectBean bean =
(ImplicitObjectBean)request.getAttribute(IMPLICIT_OBJECT_BEAN);
if(bean == null)
{
bean = new ImplicitObjectBean();
- pageContext.getRequest().setAttribute(IMPLICIT_OBJECT_BEAN, bean);
+ request.setAttribute(IMPLICIT_OBJECT_BEAN, bean);
}
bean.setPageContext(pageContext);
@@ -111,7 +112,7 @@
// @todo: need to be able to clean-up the ActionForm. right now, this
update is done for all
// calls to this method so that the action form is always 'up to date'
in the ImplicitObjectBean
// for every call. It might be possible to move this into the form
tag to add / remove as needed.
- ActionForm actionForm =
((ActionForm)pageContext.getRequest().getAttribute(org.apache.struts.taglib.html.Constants.BEAN_KEY));
+ ActionForm actionForm =
((ActionForm)request.getAttribute(org.apache.struts.taglib.html.Constants.BEAN_KEY));
bean.setActionForm(unwrapForm(actionForm));
bean.setCurrentTag(currentTag);
Modified:
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/PagerModel.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/PagerModel.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/model/PagerModel.java
Thu Oct 28 08:35:24 2004
@@ -23,6 +23,7 @@
import org.apache.beehive.netui.util.logging.Logger;
import javax.servlet.jsp.PageContext;
+import javax.servlet.http.HttpServletRequest;
/**
*
@@ -89,7 +90,8 @@
if(_pageAction != null)
{
PageContext pageContext =
JspUtil.getPageContext(_model.getJspContext());
- pageUri = PageflowTagUtils.createActionURL(pageContext,
_pageAction);
+ String qualifiedAction =
PageflowTagUtils.qualifiedAction(pageContext.getServletContext(),_pageAction);
+ pageUri = PageflowTagUtils.createActionURL((HttpServletRequest)
pageContext.getRequest(), qualifiedAction);
}
else if(_pageHref != null)
{
Modified:
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/util/JspUtil.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/util/JspUtil.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-databinding/org/apache/beehive/netui/databinding/datagrid/util/JspUtil.java
Thu Oct 28 08:35:24 2004
@@ -68,13 +68,12 @@
String internalHref = null;
if(action != null)
{
-
// simply set this to the result of mangling the action
- String actionUrl = PageflowTagUtils.getActionPath(pageContext,
action);
+ String qualifiedAction =
PageflowTagUtils.qualifiedAction(ctxt,action);
+ String actionUrl = PageflowTagUtils.createActionPath(request,
qualifiedAction);
if(URLRewriterService.needsSecure(request, ctxt, actionUrl, false))
type = URLRewriter.ACTION_SECURE;
-
- internalHref = PageflowTagUtils.createActionURL(pageContext,
action);
+ internalHref = PageflowTagUtils.createActionURL(request,
qualifiedAction);
}
else if(href != null)
{
@@ -117,7 +116,7 @@
{
if((params != null) && (params.size() > 0))
{
- StringBuffer sb = new StringBuffer(internalHref);
+ StringBuilder sb = new StringBuilder(internalHref);
String encoding = response.getCharacterEncoding();
PageflowTagUtils.addParameters(sb, encoding, false, params);
internalHref = sb.toString();
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
Thu Oct 28 08:35:24 2004
@@ -122,8 +122,9 @@
_eh = null;
// null the current tag
- ImplicitObjectBean bean =
ImplicitObjectUtil.getImplicitObjects(pageContext, this);
- bean.setCurrentTag(null);
+ //ImplicitObjectBean bean =
ImplicitObjectUtil.getImplicitObjects(pageContext, this);
+ //bean.setCurrentTag(null);
+ ImplicitObjectUtil.getImplicitObjects(pageContext, null);
}
/**
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/IScriptReporter.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/IScriptReporter.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/IScriptReporter.java
Thu Oct 28 08:35:24 2004
@@ -68,13 +68,13 @@
/**
* This method will output all of the Script associated with the script
reporter.
- * @param sb The script is written into the provided StringBuffer. This
value must not be null.
+ * @param sb The script is written into the provided StringBuilder. This
value must not be null.
*/
void writeScript(StringBuilder sb);
/**
* This method will output all of the Script that appears inside the
<head> tag.
- * @param sb The script is written into the provided StringBuffer. This
value must not be null.
+ * @param sb The script is written into the provided StringBuilder. This
value must not be null.
*/
void writeInitScript(StringBuilder sb);
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Anchor.java
Thu Oct 28 08:35:24 2004
@@ -157,6 +157,7 @@
private String _location; // anchor to be added to the end of the
hyperlink.
private String _scope; // target scope; see comments on setScope()
private String _clientAction; // The client action (javascript)
+ private Form _form; // the nearest form
private Map _params; // Parameters
private boolean _formSubmit = false; // should the anchor submit an
enclosing form?
@@ -595,13 +596,13 @@
return reportAndExit(EVAL_PAGE);
// build the anchor into the results
- StringBuilder results = new StringBuilder(128);
- StringBuilder script = new StringBuilder(128);
+ StringBuilder results = new StringBuilder(32 + ((_text != null) ?
_text.length() : 0));
+ StringBuilder script = new StringBuilder(32);
HttpServletRequest request = (HttpServletRequest)
pageContext.getRequest();
TagRenderingBase trb =
TagRenderingBase.Factory.getRendering(TagRenderingBase.ANCHOR_TAG, request);
- if (!createAnchorBeginTag(results, script, trb)) {
+ if (!createAnchorBeginTag(request, results, script, trb)) {
if (script.length() > 0)
ResponseUtils.write(pageContext, script.toString());
return reportAndExit(EVAL_PAGE);
@@ -625,13 +626,13 @@
/**
* This method will create the <a> portion of an anchor. It is called
by subclasses, for example, the
* <code>ImageAnchor</code> relies on this code to generate the <a>.
- * @param results a <code>StringBuffer</coce> to write the anchor into
- * @param script a <code>StringBuffer</code> that will contain any
JavaScript that may need to be added
+ * @param results a <code>StringBuilder</coce> to write the anchor into
+ * @param script a <code>StringBuilder</code> that will contain any
JavaScript that may need to be added
* to the generated HTML response.
* @return a boolean value indicating if an error occur creating the
anchor.
* @throws JspException
*/
- protected final boolean createAnchorBeginTag(StringBuilder results,
StringBuilder script,
+ protected final boolean createAnchorBeginTag(HttpServletRequest request,
StringBuilder results, StringBuilder script,
TagRenderingBase trb)
throws JspException
{
@@ -639,7 +640,9 @@
String formAction = null;
String idScript = null;
- HttpServletRequest request = (HttpServletRequest)
pageContext.getRequest();
+ if (_formSubmit)
+ _form = getNearestForm();
+
HttpServletResponse response = (HttpServletResponse)
pageContext.getResponse();
ServletContext ctxt = pageContext.getServletContext();
JavaScriptUtils jsu = getJavaScriptUtils(request);
@@ -697,7 +700,7 @@
// we assume that tagId will over have override id if both
// are defined.
- if (getTagId() != null) {
+ if (tagId != null) {
idScript = renderTagId(_state, null, true, false);
}
else {
@@ -713,14 +716,12 @@
String type = URLRewriter.ACTION_UNSECURE;
if (_action != null) {
-
// simply set this to the result of mangling the action
- String actionUrl = PageflowTagUtils.getActionPath(pageContext,
_action);
- if (URLRewriterService.needsSecure(request, ctxt,
- actionUrl, true))
+ String qualifiedAction =
PageflowTagUtils.qualifiedAction(ctxt,_action);
+ String actionUrl = PageflowTagUtils.createActionPath(request,
qualifiedAction);
+ if(URLRewriterService.needsSecure(request, ctxt, actionUrl,
false))
type = URLRewriter.ACTION_SECURE;
-
- internalHref = PageflowTagUtils.createActionURL(pageContext,
_action);
+ internalHref = PageflowTagUtils.createActionURL(request,
qualifiedAction);
}
else if (_href != null) {
internalHref = _href;
@@ -754,7 +755,7 @@
}
else {
if ((_params != null) && (_params.size() > 0)) {
- StringBuffer sb = new StringBuffer(internalHref);
+ StringBuilder sb = new StringBuilder(internalHref);
String encoding = response.getCharacterEncoding();
PageflowTagUtils.addParameters(sb, encoding, false,
_params);
internalHref = sb.toString();
@@ -801,9 +802,8 @@
if (_state.onClick == null && _formSubmit && formAction != null) {
String realFormName = getRealFormName();
_state.onClick = jsu.writeAnchorFormSubmitAction(realFormName,
internalHref);
-
- Form f = getNearestForm();
- f.generateRealName();
+ if (_form != null)
+ _form.generateRealName();
}
trb.doStartTag(results, _state);
@@ -898,9 +898,8 @@
*/
private String getFormAction()
{
- Form f = getNearestForm();
- if (f != null)
- return f.getAction();
+ if (_form != null)
+ return _form.getAction();
return null;
}
@@ -911,9 +910,8 @@
*/
private String getRealFormName()
{
- Form f = getNearestForm();
- if (f != null) {
- return f.getRealName();
+ if (_form != null) {
+ return _form.getRealName();
}
return null;
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/CheckBoxOption.java
Thu Oct 28 08:35:24 2004
@@ -231,7 +231,7 @@
ConstantRendering cr =
TagRenderingBase.Factory.getConstantRendering(req);
boolean repeat = parent.isRepeater();
- // StringBuffer for the results
+ // StringBuilder for the results
StringBuilder results = new StringBuilder(128);
if (!repeat && parent.isVertical()) {
cr.TR_TD(results);
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
Thu Oct 28 08:35:24 2004
@@ -741,7 +741,7 @@
_state.method = FORM_POST;
// encode the action
- String actionUrl =
PageflowTagUtils.getRewrittenFormAction(_state.action, pageContext);
+ String actionUrl = PageflowTagUtils.getRewrittenFormAction(request,
_state.action, pageContext);
// If the rewritten form action contains request parameters, turn them
into hidden fields --
// it's not legal to include them in the action URI on a GET.
@@ -878,7 +878,7 @@
* Write a hidden field for a paramter
* @param paramName The name of the parameter
* @param paramValue The value of the paramter
- * @param results The StringBuffer to append the result to
+ * @param results The StringBuilder to append the result to
* @param req THe servlet request
*/
private void writeHiddenParam(String paramName, String paramValue,
StringBuilder results, ServletRequest req)
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Html.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Html.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Html.java
Thu Oct 28 08:35:24 2004
@@ -264,7 +264,7 @@
// String script = writeScriptBlock();
// ResponseUtils.write(pageContext, script);
- StringBuilder sb = new StringBuilder(128);
+ StringBuilder sb = new StringBuilder(256);
if (_saveBody != null)
sb.append(_saveBody);
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/HtmlBaseTag.java
Thu Oct 28 08:35:24 2004
@@ -25,6 +25,7 @@
import org.apache.beehive.netui.util.Bundle;
import javax.servlet.ServletContext;
+import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;
@@ -655,7 +656,7 @@
* @param request the HttpServletRequest associated with this request
* @return a <code>JavaScriptUtils</code> assocated with the request
*/
- static JavaScriptUtils getJavaScriptUtils(HttpServletRequest request)
+ static JavaScriptUtils getJavaScriptUtils(ServletRequest request)
{
assert (request != null);
JavaScriptUtils jsu = (JavaScriptUtils)
request.getAttribute(JAVASCRIPT_STATUS);
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageAnchor.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageAnchor.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ImageAnchor.java
Thu Oct 28 08:35:24 2004
@@ -467,7 +467,7 @@
return EVAL_PAGE;
}
- ServletRequest req = pageContext.getRequest();
+ HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
// build the anchor into the results
StringBuilder results = new StringBuilder(128);
@@ -475,7 +475,7 @@
// render the anchor tag
TagRenderingBase trb =
TagRenderingBase.Factory.getRendering(TagRenderingBase.ANCHOR_TAG, req);
- if (!createAnchorBeginTag(results, script, trb)) {
+ if (!createAnchorBeginTag(req, results, script, trb)) {
reportErrors();
if (script.length() > 0)
write(script.toString());
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/JavaScriptUtils.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/JavaScriptUtils.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/JavaScriptUtils.java
Thu Oct 28 08:35:24 2004
@@ -24,7 +24,9 @@
import java.util.ResourceBundle;
/**
- * Provides tag specific support for the HTML tags so they can create
JavaScript.
+ * Provides tag specific support for the HTML tags so they can create
JavaScript. There is a bundle
+ * which contains all of the Java Script. This bundle will be cached inside
this class. THe properties
+ * file does not get i18n support.
*/
public class JavaScriptUtils implements Serializable
{
@@ -32,6 +34,7 @@
private boolean _anchorFormSubmit = false;
private boolean _rollover = false;
private boolean _writeLookupMethods = false;
+ private static ResourceBundle _bundle;
public String writeAnchorFormSubmit(IScriptReporter scriptReporter)
{
@@ -52,7 +55,7 @@
return null;
}
- StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder(64);
writeScriptBlock(sb, s);
return sb.toString();
}
@@ -80,7 +83,7 @@
// @TODO: Need to escaping
String s = getString("setFocus", new Object[]{formName, fieldName});
- StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder(192);
writeScriptBlock(sb, s);
return sb.toString();
}
@@ -96,7 +99,7 @@
String meths = writeNetuiNameFunctions(null);
if (meths != null)
s += meths;
- StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder(256);
writeScriptBlock(sb, s);
return sb.toString();
}
@@ -116,7 +119,7 @@
return null;
}
- StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder(256);
writeScriptBlock(sb, s);
return sb.toString();
}
@@ -140,7 +143,7 @@
// allocate a String Buffer only if there is no script reporter
StringBuilder sb = null;
if (scriptReporter == null)
- sb = new StringBuilder();
+ sb = new StringBuilder(256);
String s = getString("getNetuiTagNameAdvanced", null);
if (scriptReporter != null)
@@ -200,10 +203,13 @@
/**
* Returns the resource bundle named Bundle[].properties in the
* package of the specified class.
+ * This is ok to cache because we don't localize the JavaScript resources.
*/
private static ResourceBundle getBundle()
{
- return ResourceBundle.getBundle(BUNDLE_NAME);
+ if (_bundle == null)
+ _bundle = ResourceBundle.getBundle(BUNDLE_NAME);;
+ return _bundle;
}
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Parameter.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Parameter.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Parameter.java
Thu Oct 28 08:35:24 2004
@@ -25,9 +25,8 @@
import org.apache.beehive.netui.util.Bundle;
import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.tagext.Tag;
-import javax.servlet.jsp.tagext.SimpleTagSupport;
import javax.servlet.jsp.tagext.JspTag;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
/**
* Writes a URL parameter to a URL on its parent tag. The parent tag must
implement URLParams.
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptContainer.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptContainer.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ScriptContainer.java
Thu Oct 28 08:35:24 2004
@@ -176,7 +176,7 @@
/**
* This method will output all of the Script associated with the script
reporter.
- * @param sb The script is written into the provided StringBuffer. This
value must not be null.
+ * @param sb The script is written into the provided StringBuilder. This
value must not be null.
*/
public void writeScript(StringBuilder sb)
{
@@ -193,7 +193,7 @@
/**
* This method will output all of the Script that appears inside the
<head> tag.
- * @param sb The script is written into the provided StringBuffer. This
value must not be null.
+ * @param sb The script is written into the provided StringBuilder. This
value must not be null.
*/
public void writeInitScript(StringBuilder sb)
{
@@ -360,7 +360,7 @@
/**
* This method will define the NetUI constructor. NetUI is the root level
* variable that acts as a container for the JavaScript infrastructure
supported by NetUI.
- * @param sb A StringBuffer to write the new script block into
+ * @param sb A StringBuilder to write the new script block into
*/
protected void defineNetUIScope(StringBuilder sb)
{
@@ -416,7 +416,7 @@
{
processIdMap();
- StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder(256);
if (_codeBlocks != null && _codeBlocks.size() > 0) {
String s = JavaScriptUtils.getString("codeComment", null);
sb.append(s);
@@ -444,7 +444,7 @@
if (sb.length() == 0)
return "";
- StringBuilder out = new StringBuilder();
+ StringBuilder out = new StringBuilder(256);
JavaScriptUtils.writeScriptBlock(out, sb.toString());
return out.toString();
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/javaScript.properties
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/javaScript.properties
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/javaScript.properties
Thu Oct 28 08:35:24 2004
@@ -1,5 +1,7 @@
# This properties files defines all of the JavaScript generated by the HTML
-# tags. This file does not need I18N support.
+# tags. This file does not need I18N support. In fact, if this is
internationalized
+# the JavaScriptUtils class needs updating because it caches the Bundle
internally
+# so it is only looked up once.
# This is a header comment for the code that will run when the page is loaded
codeComment=\
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/TagRenderingBase.java
Thu Oct 28 08:35:24 2004
@@ -84,15 +84,15 @@
/**
* Render the start tag for an element. The element will render the tag
and all of it's
- * attributes into a StringBuffer.
- * @param sb A StringBuffer where the element start tag is
appended.
+ * attributes into a StringBuilder.
+ * @param sb A StringBuilder where the element start tag is
appended.
* @param renderState The state assocated with the element.
*/
abstract public void doStartTag(StringBuilder sb, AbstractTagState
renderState);
/**
* Render the end tag for an element. The end tag will be rendered if the
tag requires an end tag.
- * @param sb A StringBuffer where the element end tag may be appended.
+ * @param sb A StringBuilder where the element end tag may be appended.
*/
abstract public void doEndTag(StringBuilder sb);
@@ -121,11 +121,11 @@
}
/**
- * This method will append an attribute value to a StringBuffer.
+ * This method will append an attribute value to a StringBuilder.
* The method assumes that the attr is not <code>null</code>. If the
* <code>value</code> attribute is <code>null</code> the attribute will
not be appended to the
- * <code>StringBuffer</code>.
- * @param buf The StringBuffer to append the attribute into.
+ * <code>StringBuilder</code>.
+ * @param buf The StringBuilder to append the attribute into.
* @param name The name of the attribute
* @param value The value of teh attribute. If this is <code>null</code>
the attribute will not be written.
*/
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
Thu Oct 28 08:35:24 2004
@@ -598,7 +598,7 @@
// prepare to render the tree
HttpServletRequest request = (HttpServletRequest)
pageContext.getRequest();
HttpServletResponse response = (HttpServletResponse)
pageContext.getResponse();
- StringBuilder sb = new StringBuilder();
+ StringBuilder sb = new StringBuilder(1024);
// this is the treeId from the request. If there was an tree
expansion this will be
// non-null and it identifies what tree had the expansion request.
@@ -735,7 +735,7 @@
boolean devMode =
!ContextCache.get(servletContext).getServerAdapter().isInProductionMode();
if (devMode) {
boolean error = false;
- StringBuilder errorText = new StringBuilder();
+ StringBuilder errorText = new StringBuilder(64);
if (node.getName() == null) {
errorText.append("name");
error = true;
@@ -858,7 +858,8 @@
// process the action into a URL
PageContext pageContext = getPageContext();
if (action != null && selectionLink == null) {
- selectionLink = PageflowTagUtils.createActionURL(pageContext,
action);
+ String qualifiedAction =
PageflowTagUtils.qualifiedAction(pageContext.getServletContext(),action);
+ selectionLink = PageflowTagUtils.createActionURL(request,
qualifiedAction);
selectionLink = PageflowTagUtils.addParam(selectionLink,
TreeElement.SELECTED_NODE, encodedNodeName);
if (_tagId != null)
selectionLink = PageflowTagUtils.addParam(selectionLink,
TreeElement.TREE_ID, _tagId);
@@ -999,7 +1000,8 @@
registerTagError(Bundle.getString("Tags_BadAction", action), null);
return false;
}
- action = PageflowTagUtils.createActionURL(pageContext, action);
+ String qualifiedAction =
PageflowTagUtils.qualifiedAction(pageContext.getServletContext(),action);
+ action = PageflowTagUtils.createActionURL(request, qualifiedAction);
action = PageflowTagUtils.prepareActionUrl(pageContext, action);
// encode the tree parameters into the action.
Modified:
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/HtmlExceptionFormatter.java
==============================================================================
---
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/HtmlExceptionFormatter.java
(original)
+++
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/HtmlExceptionFormatter.java
Thu Oct 28 08:35:24 2004
@@ -45,7 +45,7 @@
/* Note, this is not a valid replacement for real logging. */
public static String format(String message, Throwable t, boolean
stackTrace)
{
- StringBuilder buf = new StringBuilder();
+ StringBuilder buf = new StringBuilder(256);
if (message != null)
{
Modified:
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/type/TypeUtils.java
==============================================================================
---
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/type/TypeUtils.java
(original)
+++
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/util/type/TypeUtils.java
Thu Oct 28 08:35:24 2004
@@ -187,7 +187,7 @@
if(_toString != null)
return _toString;
- StringBuilder buf = new StringBuilder();
+ StringBuilder buf = new StringBuilder(128);
buf.append(TypeUtils.class.getName() + " regestered converters (class
name, TypeConverter implementation):\n");
buf.append(":::::\n");
Iterator iterator = _converters.keySet().iterator();