Author: jkuhnert
Date: Sun May 20 17:47:00 2007
New Revision: 539986
URL: http://svn.apache.org/viewvc?view=rev&rev=539986
Log:
TAPESTRY-1206. IE doesn't like replacing the textual content of select
elements. bastards
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/ApplicationServlet.java
tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js
Modified:
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/ApplicationServlet.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/ApplicationServlet.java?view=diff&rev=539986&r1=539985&r2=539986
==============================================================================
---
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/ApplicationServlet.java
(original)
+++
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/ApplicationServlet.java
Sun May 20 17:47:00 2007
@@ -14,16 +14,6 @@
package org.apache.tapestry;
-import java.io.IOException;
-import java.util.Locale;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hivemind.ClassResolver;
@@ -39,13 +29,22 @@
import org.apache.tapestry.services.ServletRequestServicer;
import org.apache.tapestry.util.exception.ExceptionAnalyzer;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Locale;
+
/**
* Links a servlet container with a Tapestry application. The servlet init
parameter
* <code>org.apache.tapestry.application-specification</code> should be set to
the complete
* resource path (within the classpath) to the application specification, i.e.,
* <code>/com/foo/bar/MyApp.application</code>. As of release 4.0, this
servlet will also create
* a HiveMind Registry and manage it.
- *
+ *
* @author Howard Lewis Ship
* @see org.apache.tapestry.services.ApplicationInitializer
* @see org.apache.tapestry.services.ServletRequestServicer
@@ -59,7 +58,7 @@
* Prefix used to store the HiveMind Registry into the ServletContext.
This string is suffixed
* with the servlet name (in case multiple Tapestry applications are
executing within a single
* web application).
- *
+ *
* @since 4.0
*/
@@ -75,7 +74,7 @@
/**
* The key used to store the registry into the ServletContext.
- *
+ *
* @since 4.0
*/
@@ -91,10 +90,10 @@
* @since 4.0
*/
private ServletRequestServicer _requestServicer;
-
+
/**
* Invokes [EMAIL PROTECTED] #doService(HttpServletRequest,
HttpServletResponse)}.
- *
+ *
* @since 1.0.6
*/
@@ -106,10 +105,14 @@
/**
* Handles the GET and POST requests. Performs the following:
+ *
* <ul>
- * <li>Construct a [EMAIL PROTECTED] RequestContext}
- * <li>Invoke [EMAIL PROTECTED] #getEngine(RequestContext)}to get or
create the [EMAIL PROTECTED] IEngine}
- * <li>Invoke [EMAIL PROTECTED] IEngine#service(RequestContext)}on the
application
+ * <li>
+ * Invokes [EMAIL PROTECTED] org.apache.hivemind.Registry#setupThread()}
+ * </li>
+ * <li>
+ * Invokes [EMAIL PROTECTED]
ServletRequestServicer#service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)}.
+ * </li>
* </ul>
*/
@@ -171,7 +174,7 @@
/**
* Reads the application specification when the servlet is first
initialized. All
* [EMAIL PROTECTED] IEngine engine instances}will have access to the
specification via the servlet.
- *
+ *
* @see #constructRegistry(ServletConfig)
* @see #createClassResolver()
*/
@@ -215,10 +218,10 @@
* Invoked from [EMAIL PROTECTED] #init(ServletConfig)}to create a
resource resolver for the servlet
* (which will utlimately be shared and used through the application).
* <p>
- * This implementation constructs a [EMAIL PROTECTED]
DefaultResourceResolver}, subclasses may provide a
+ * This implementation constructs a [EMAIL PROTECTED]
DefaultClassResolver}, subclasses may provide a
* different implementation.
- *
- * @see #getResourceResolver()
+ *
+ * @see DefaultClassResolver
* @since 2.3
*/
@@ -233,7 +236,7 @@
* <p>
* This looks in the standard places (on the classpath), but also in the
WEB-INF/name and
* WEB-INF folders (where name is the name of the servlet).
- *
+ *
* @since 4.0
*/
protected Registry constructRegistry(ServletConfig config)
@@ -258,7 +261,7 @@
* [EMAIL PROTECTED] ErrorHandler} instance to be used when constructing
the Registry (and then to handle
* any runtime exceptions). This implementation returns a new instance of
* [EMAIL PROTECTED] org.apache.hivemind.impl.StrictErrorHandler}.
- *
+ *
* @since 4.0
*/
protected ErrorHandler constructErrorHandler(ServletConfig config)
@@ -269,7 +272,7 @@
/**
* Looks for a file in the servlet context; if it exists, it is expected
to be a HiveMind module
* descriptor, and is added to the builder.
- *
+ *
* @since 4.0
*/
@@ -287,7 +290,7 @@
* Invoked from [EMAIL PROTECTED] #init(ServletConfig)}, after the
registry has been constructed, to
* bootstrap the application via the
<code>tapestry.MasterApplicationInitializer</code>
* service.
- *
+ *
* @since 4.0
*/
protected void initializeApplication()
@@ -307,7 +310,7 @@
/**
* Shuts down the registry (if it exists).
- *
+ *
* @since 4.0
*/
public void destroy()
@@ -319,7 +322,7 @@
_registry.shutdown();
_registry = null;
}
-
+
super.destroy();
}
}
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js
URL:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js?view=diff&rev=539986&r1=539985&r2=539986
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js Sun May
20 17:47:00 2007
@@ -243,11 +243,17 @@
if (djConfig["isDebug"]) {
dojo.log.debug("Received element content for id <" + id + ">
of: ", content);
}
- if (content && content.length > 0) {
- node.innerHTML=content;
- }
-
- // copy attributes
+
+ // fix for IE - setting innerHTML does not work for SELECTs
+ if (tapestry.isIE && node.outerHTML && node.nodeName == "SELECT") {
+ node.outerHTML =
node.outerHTML.replace(/(<SELECT[^<]*>).*(<\/SELECT>)/, '$1' + content + '$2');
+ } else {
+ if (content && content.length > 0) {
+ node.innerHTML=content;
+ }
+ }
+
+ // copy attributes
var atts=element.attributes;
var attnode, i=0;
while((attnode=atts[i++])){