You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2007/02/23 07:27:19 UTC
svn commit: r510847 - in /tapestry/tapestry5/tapestry-core/trunk/src:
main/java/org/apache/tapestry/corelib/components/
main/java/org/apache/tapestry/corelib/pages/
main/java/org/apache/tapestry/internal/
main/java/org/apache/tapestry/internal/services...
Author: hlship
Date: Thu Feb 22 22:27:17 2007
New Revision: 510847
URL: http://svn.apache.org/viewvc?view=rev&rev=510847
Log:
Extend the ExceptionReport page, adding a new RenderObject component with an underlying ObjectRenderer service.
Add customized object rendering for Request and Location.
Improve the readability of the default ExceptionReport page (via improvements to default.css).
Added:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/RenderObject.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/LocationRenderer.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/RequestRenderer.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/ObjectRenderer.java
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/InternalConstants.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/RequestImpl.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/Request.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/TapestryModule.java
tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/Grid.html
tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html
tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/default.css
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/Start.html
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html
Added: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/RenderObject.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/RenderObject.java?view=auto&rev=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/RenderObject.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/components/RenderObject.java Thu Feb 22 22:27:17 2007
@@ -0,0 +1,41 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.corelib.components;
+
+import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.annotations.Inject;
+import org.apache.tapestry.annotations.Parameter;
+import org.apache.tapestry.corelib.pages.ExceptionReport;
+import org.apache.tapestry.services.ObjectRenderer;
+
+/**
+ * Renders out an object using the {@link ObjectRenderer} service. Used primarily on the
+ * {@link ExceptionReport} page.
+ */
+public class RenderObject
+{
+ @Parameter(required = true)
+ private Object _object;
+
+ @Inject("infrastructure:ObjectRenderer")
+ private ObjectRenderer<Object> _renderer;
+
+ boolean beginRender(MarkupWriter writer)
+ {
+ _renderer.render(_object, writer);
+
+ return false;
+ }
+}
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java?view=diff&rev=510847&r1=510846&r2=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java Thu Feb 22 22:27:17 2007
@@ -91,8 +91,8 @@
public boolean getShowPropertyList()
{
// True if either is non-empty
-
- return ! (_info.getPropertyNames().isEmpty() && _info.getStackTrace().isEmpty());
+
+ return !(_info.getPropertyNames().isEmpty() && _info.getStackTrace().isEmpty());
}
public Object getPropertyValue()
@@ -103,6 +103,11 @@
public boolean getHasSession()
{
return _request.getSession(false) != null;
+ }
+
+ public Request getRequest()
+ {
+ return _request;
}
public Session getSession()
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/InternalConstants.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/InternalConstants.java?view=diff&rev=510847&r1=510846&r2=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/InternalConstants.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/InternalConstants.java Thu Feb 22 22:27:17 2007
@@ -37,6 +37,8 @@
public static final String PAGE_CONTEXT_NAME = "t:ac";
+ public static final String OBJECT_RENDER_DIV_SECTION = "t-env-data-section";
+
private InternalConstants()
{
}
Added: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/LocationRenderer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/LocationRenderer.java?view=auto&rev=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/LocationRenderer.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/LocationRenderer.java Thu Feb 22 22:27:17 2007
@@ -0,0 +1,113 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.internal.services;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.net.URL;
+
+import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.internal.TapestryUtils;
+import org.apache.tapestry.ioc.Location;
+import org.apache.tapestry.ioc.Resource;
+import org.apache.tapestry.services.ObjectRenderer;
+
+public class LocationRenderer implements ObjectRenderer<Location>
+{
+ private static final int RANGE = 5;
+
+ public void render(Location location, MarkupWriter writer)
+ {
+ writer.write(location.toString());
+
+ Resource r = location.getResource();
+ int line = location.getLine();
+
+ // No line number? then nothing more to render.
+
+ if (line <= 0)
+ return;
+
+ URL url = r.toURL();
+
+ if (url == null)
+ return;
+
+ int start = line - RANGE;
+ int end = line + RANGE;
+
+ writer.element("table", "class", "t-location-outer");
+
+ LineNumberReader reader = null;
+
+ try
+ {
+ InputStream is = new BufferedInputStream(url.openStream());
+ InputStreamReader isr = new InputStreamReader(is);
+ reader = new LineNumberReader(new BufferedReader(isr));
+
+ while (true)
+ {
+ String input = reader.readLine();
+
+ if (input == null) break;
+
+ int current = reader.getLineNumber();
+
+ if (current < start) continue;
+
+ if (current > end) break;
+
+ writer.element("tr");
+
+ writer.element("td");
+ writer.attributes("class", line == current ? "t-location-line t-location-current" : "t-location-line");
+ writer.write(Integer.toString(current));
+ writer.end();
+
+ String css = "t-location-content";
+ if (line == current)
+ css += " t-location-current";
+ if (start == current)
+ css += " t-location-content-first";
+
+ writer.element("td");
+ writer.attributes("class", css);
+ writer.write(input);
+ writer.end();
+
+ writer.end(); // tr
+ }
+
+ reader.close();
+ reader = null;
+ }
+ catch (IOException ex)
+ {
+ writer.write(ex.toString());
+ }
+ finally
+ {
+ TapestryUtils.close(reader);
+ }
+
+ writer.end(); // div
+ }
+
+}
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/RequestImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/RequestImpl.java?view=diff&rev=510847&r1=510846&r2=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/RequestImpl.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/RequestImpl.java Thu Feb 22 22:27:17 2007
@@ -42,6 +42,11 @@
return InternalUtils.toList(_request.getParameterNames());
}
+ public List<String> getHeaderNames()
+ {
+ return InternalUtils.toList(_request.getHeaderNames());
+ }
+
public String getParameter(String name)
{
return _request.getParameter(name);
@@ -50,6 +55,11 @@
public String[] getParameters(String name)
{
return _request.getParameterValues(name);
+ }
+
+ public String getHeader(String name)
+ {
+ return _request.getHeader(name);
}
public String getPath()
Added: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/RequestRenderer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/RequestRenderer.java?view=auto&rev=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/RequestRenderer.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/RequestRenderer.java Thu Feb 22 22:27:17 2007
@@ -0,0 +1,142 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.internal.services;
+
+import java.util.List;
+
+import org.apache.tapestry.MarkupWriter;
+import org.apache.tapestry.internal.InternalConstants;
+import org.apache.tapestry.services.ObjectRenderer;
+import org.apache.tapestry.services.Request;
+
+public class RequestRenderer implements ObjectRenderer<Request>
+{
+ public void render(Request request, MarkupWriter writer)
+ {
+ writer.element("dl");
+
+ dt(writer, "Context Path");
+
+ writer.element("dd");
+
+ String contextPath = request.getContextPath();
+
+ if (contextPath.equals(""))
+ {
+ writer.element("em");
+ writer.write("none (deployed as root)");
+ writer.end();
+ }
+ else
+ {
+ writer.write(contextPath);
+ }
+ writer.end(); // dd
+
+ dd(writer, request.getContextPath());
+
+ dt(writer, "Request Path");
+ dd(writer, request.getPath());
+
+ dt(writer, "Locale");
+ dd(writer, request.getLocale().toString());
+
+ writer.end();
+
+ parameters(request, writer);
+ headers(request, writer);
+ }
+
+ private void parameters(Request request, MarkupWriter writer)
+ {
+ List<String> parameterNames = request.getParameterNames();
+
+ if (parameterNames.isEmpty())
+ return;
+
+ section(writer, "Query Parameters");
+
+ writer.element("dl");
+
+ for (String name : parameterNames)
+ {
+ String[] values = request.getParameters(name);
+
+ dt(writer, name);
+
+ writer.element("dd");
+
+ if (values.length > 1)
+ {
+ writer.element("ul");
+
+ for (String value : values)
+ {
+ writer.element("li");
+ writer.write(value);
+ writer.end();
+ }
+
+ writer.end(); // ul
+ }
+ else
+ {
+ writer.write(values[0]);
+ }
+
+ writer.end(); // dd
+ }
+
+ writer.end(); // dl
+ }
+
+ private void dt(MarkupWriter writer, String name)
+ {
+ writer.element("dt");
+ writer.write(name);
+ writer.end();
+ }
+
+ private void dd(MarkupWriter writer, String name)
+ {
+ writer.element("dd");
+ writer.write(name);
+ writer.end();
+ }
+
+ private void section(MarkupWriter writer, String name)
+ {
+ writer.element("div", "class", InternalConstants.OBJECT_RENDER_DIV_SECTION);
+ writer.write(name);
+ writer.end();
+ }
+
+ private void headers(Request request, MarkupWriter writer)
+ {
+ section(writer, "Headers");
+
+ writer.element("dl");
+
+ for (String name : request.getHeaderNames())
+ {
+ dt(writer, name);
+ dd(writer, request.getHeader(name));
+ }
+
+ writer.end(); // dl
+
+ }
+
+}
Added: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/ObjectRenderer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/ObjectRenderer.java?view=auto&rev=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/ObjectRenderer.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/ObjectRenderer.java Thu Feb 22 22:27:17 2007
@@ -0,0 +1,34 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.services;
+
+import org.apache.tapestry.MarkupWriter;
+
+/**
+ * A strategy interface used for converting an object into markup that describes that object. This
+ * is primarily used in terms of an {@link ExceptionReporter} page.
+ */
+public interface ObjectRenderer<T>
+{
+ /**
+ * Renders the object out as markup.
+ *
+ * @param object
+ * to be rendered
+ * @param writer
+ * to which output should be directed
+ */
+ void render(T object, MarkupWriter writer);
+}
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/Request.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/Request.java?view=diff&rev=510847&r1=510846&r2=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/Request.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/Request.java Thu Feb 22 22:27:17 2007
@@ -47,6 +47,9 @@
/** Returns the locale of the client as determined from the request headers. */
Locale getLocale();
+ /** Returns the names of all headers in the request. */
+ List<String> getHeaderNames();
+
/**
* Returns the value of the specified request header as a <code>long</code> value that
* represents a <code>Date</code> object. Use this method with headers that contain dates,
@@ -68,4 +71,7 @@
* If the header value can't be converted to a date
*/
long getDateHeader(String name);
+
+ /** Returns the named header as a string, or null if not found. */
+ String getHeader(String name);
}
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/TapestryModule.java?view=diff&rev=510847&r1=510846&r2=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/TapestryModule.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/services/TapestryModule.java Thu Feb 22 22:27:17 2007
@@ -108,6 +108,7 @@
import org.apache.tapestry.internal.services.InternalModule;
import org.apache.tapestry.internal.services.LinkActionResponseGenerator;
import org.apache.tapestry.internal.services.LinkFactory;
+import org.apache.tapestry.internal.services.LocationRenderer;
import org.apache.tapestry.internal.services.MarkupWriterImpl;
import org.apache.tapestry.internal.services.MetaDataLocatorImpl;
import org.apache.tapestry.internal.services.MetaWorker;
@@ -128,6 +129,7 @@
import org.apache.tapestry.internal.services.RequestGlobalsImpl;
import org.apache.tapestry.internal.services.RequestImpl;
import org.apache.tapestry.internal.services.RequestPageCache;
+import org.apache.tapestry.internal.services.RequestRenderer;
import org.apache.tapestry.internal.services.ResourceCache;
import org.apache.tapestry.internal.services.ResourceDigestGeneratorImpl;
import org.apache.tapestry.internal.services.ResourceStreamer;
@@ -150,6 +152,7 @@
import org.apache.tapestry.internal.structure.DefaultComponentParameterBindingSourceImpl;
import org.apache.tapestry.ioc.Configuration;
import org.apache.tapestry.ioc.IOCUtilities;
+import org.apache.tapestry.ioc.Location;
import org.apache.tapestry.ioc.MappedConfiguration;
import org.apache.tapestry.ioc.Messages;
import org.apache.tapestry.ioc.ObjectProvider;
@@ -566,6 +569,7 @@
FieldValidatorSource.class,
MarkupWriterFactory.class,
MetaDataLocator.class,
+ ObjectRenderer.class,
PersistentFieldManager.class,
PropertyConduitSource.class,
Request.class,
@@ -1455,5 +1459,34 @@
BindingSource bindingSource)
{
return new DefaultComponentParameterBindingSourceImpl(_propertyAccess, bindingSource);
+ }
+
+ public ObjectRenderer buildObjectRenderer(@InjectService("tapestry.ioc.StrategyBuilder")
+ StrategyBuilder strategyBuilder, Map<Class, ObjectRenderer> configuration)
+ {
+ StrategyRegistry<ObjectRenderer> registry = StrategyRegistry.newInstance(
+ ObjectRenderer.class,
+ configuration);
+
+ return _strategyBuilder.build(registry);
+ }
+
+ /**
+ * Contributes a default object renderer for type Object, plus specialized renderers for
+ * {@link Request} and {@link Location}.
+ */
+ public void contributeObjectRenderer(MappedConfiguration<Class, ObjectRenderer> configuration)
+ {
+ configuration.add(Object.class, new ObjectRenderer()
+ {
+ public void render(Object object, MarkupWriter writer)
+ {
+ writer.write(String.valueOf(object));
+ }
+ });
+
+ configuration.add(Request.class, new RequestRenderer());
+
+ configuration.add(Location.class, new LocationRenderer());
}
}
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/Grid.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/Grid.html?view=diff&rev=510847&r1=510846&r2=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/Grid.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/Grid.html Thu Feb 22 22:27:17 2007
@@ -2,7 +2,7 @@
<t:comp id="pagerTop"/>
- <table class="t-data-grid" cellspacing="0">
+ <table class="t-data-grid">
<thead t:id="columns"/>
<tbody>
<t:comp id="rows"/>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html?view=diff&rev=510847&r1=510846&r2=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html Thu Feb 22 22:27:17 2007
@@ -22,7 +22,9 @@
<dl>
<t:comp type="Loop" source="info.propertyNames" value="propertyName">
<dt>${propertyName}</dt>
- <dd>${propertyValue}</dd>
+ <dd>
+ <t:comp type="renderobject" object="propertyValue"/>
+ </dd>
</t:comp>
<t:comp type="If" test="info.stackTrace">
<dt>Stack trace</dt>
@@ -41,13 +43,16 @@
</t:comp>
</ul>
</div>
- <div class="t-env-data">
+ <div class="t-env-data">
+ <h2>Request</h2>
+ <t:comp type="renderobject" object="request"/>
+
<t:comp type="If" test="hasSession">
<h2>Session</h2>
<dl>
<t:comp type="Loop" source="session.attributeNames" value="attributeName">
<dt>${attributeName}</dt>
- <dd>${attributeValue}</dd>
+ <dd><t:comp type="renderobject" object="attributeValue"/></dd>
</t:comp>
</dl>
</t:comp>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/default.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/default.css?view=diff&rev=510847&r1=510846&r2=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/default.css (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/default.css Thu Feb 22 22:27:17 2007
@@ -60,6 +60,7 @@
{
color:green;
padding-left: 2px;
+ background-color: #FFFFCF;
}
DIV.t-exception-report LI
@@ -72,7 +73,7 @@
display: block;
margin-top: 15px;
font-size: 12pt;
- background-color: #c0c0c0;
+ background-color: #E1E1E1;
color: blue;
padding: 2px 3px;
font-weight: bold;
@@ -174,6 +175,7 @@
TABLE.t-data-grid
{
+ border-collapse: collapse;
border-left: 1px solid silver;
}
@@ -223,4 +225,65 @@
IMG
{
border: none;
+}
+
+
+DIV.t-env-data-section
+{
+ padding-left: 5px;
+}
+
+DIV.t-env-data DD, DIV.t-exception-report DD
+{
+ margin-left: 25px;
+ margin-bottom: 10px;
+}
+
+DIV.t-env-data LI
+{
+ margin-left: -25px;
+}
+
+DIV.t-env-data-section
+{
+ font-size: 12pt;
+ background-color: #E1E1E1;
+ color: blue;
+ padding: 2px 3px;
+ font-weight: bold;
+}
+
+TABLE.t-location-outer
+{
+ padding: 5px;
+ border-collapse: collapse;
+ border: 1px solid black;
+ width: 100%;
+}
+
+TD.t-location-line
+{
+ width: 40px;
+ text-align: right;
+ padding: none;
+ background-color: #E1E1E1;
+ padding-right: 3px;
+ border-right: 1px solid black;
+}
+
+TD.t-location-content
+{
+ border-top: 1px solid silver;
+ border-right: 1px solid black;
+ white-space: pre;
+}
+
+TD.t-location-current
+{
+ background-color: #FFFFCF;
+}
+
+TD.t-location-content-first
+{
+ border-top: 1px solid black;
}
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/Start.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/Start.html?view=diff&rev=510847&r1=510846&r2=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/Start.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/Start.html Thu Feb 22 22:27:17 2007
@@ -27,8 +27,6 @@
<a t:type="PageLink" page="expansion">Expansion Page</a>
</li>
<li>
- <a href="MissingPage">Missing Page</a> -- Used to test exception reporting </li>
- <li>
<a href="BadTemplate">BadTemplate Page</a> -- More exception reporting </li>
<li>
<a t:type="PageLink" page="ActionPage">Action Page</a> -- tests fixture for
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?view=diff&rev=510847&r1=510846&r2=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java Thu Feb 22 22:27:17 2007
@@ -182,10 +182,11 @@
clickAndWait("link=BadTemplate Page");
- assertTextPresent("org.apache.tapestry.ioc.internal.util.TapestryException");
- assertTextPresent("Failure parsing template classpath:org/apache/tapestry/integration/app1/pages/BadTemplate.html");
- assertTextPresent("org.xml.sax.SAXParseException");
- assertTextPresent("XML document structures must start and end within the same entity.");
+ assertTextPresent(
+ "org.apache.tapestry.ioc.internal.util.TapestryException",
+ "Failure parsing template classpath:org/apache/tapestry/integration/app1/pages/BadTemplate.html, line 7, column 15",
+ "<t:foobar>content from template</t:foobar>",
+ "Element <t:foobar> is in the Tapestry namespace, but is not a recognized Tapestry template element.");
}
@Test
@@ -919,7 +920,7 @@
public void page_link_with_explicit_activation_context()
{
_selenium.open(BASE_URL);
-
+
clickAndWait("link=PageLink Context Demo");
clickAndWait("link=no context");
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html?view=diff&rev=510847&r1=510846&r2=510847
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html Thu Feb 22 22:27:17 2007
@@ -1,10 +1,13 @@
<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<p>
- This template is missing its close tag (</t:comp>) and that's going to
- cause some havoc!
+ This template includes an invalid element in the Tapestry namespace.
</p>
+ <t:foobar>content from template</t:foobar>
+
<p>
This page is used to test exception reporting.
- </p>
\ No newline at end of file
+ </p>
+
+</t:comp>
\ No newline at end of file