You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2008/03/15 16:48:45 UTC
svn commit: r637434 [2/2] - in /tiles/framework/trunk:
tiles-api/src/main/java/org/apache/tiles/
tiles-api/src/main/java/org/apache/tiles/access/
tiles-api/src/main/java/org/apache/tiles/mgmt/
tiles-api/src/test/java/org/apache/tiles/access/ tiles-core...
Added: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/CannotInstantiateObjectException.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/CannotInstantiateObjectException.java?rev=637434&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/CannotInstantiateObjectException.java (added)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/CannotInstantiateObjectException.java Sat Mar 15 08:48:38 2008
@@ -0,0 +1,73 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.tiles.util;
+
+import org.apache.tiles.TilesException;
+
+/**
+ * Indicates that an object cannot be instantiated.
+ *
+ * @version $Rev$ $Date$
+ * @since 2.1.0
+ */
+public class CannotInstantiateObjectException extends TilesException {
+
+ /**
+ * Constructor.
+ *
+ * @since 2.1.0
+ */
+ public CannotInstantiateObjectException() {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message The detail message.
+ * @since 2.1.0
+ */
+ public CannotInstantiateObjectException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param e The exception to be wrapped.
+ * @since 2.1.0
+ */
+ public CannotInstantiateObjectException(Exception e) {
+ super(e);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message The detail message.
+ * @param e The exception to be wrapped.
+ * @since 2.1.0
+ */
+ public CannotInstantiateObjectException(String message, Exception e) {
+ super(message, e);
+ // TODO Auto-generated constructor stub
+ }
+
+}
Propchange: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/CannotInstantiateObjectException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/CannotInstantiateObjectException.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/ClassUtil.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/ClassUtil.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/ClassUtil.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/util/ClassUtil.java Sat Mar 15 08:48:38 2008
@@ -20,9 +20,6 @@
*/
package org.apache.tiles.util;
-import org.apache.tiles.TilesException;
-
-
/**
* Utilities to work with dynamic class loading and instantiation.
*
@@ -42,9 +39,10 @@
*
* @param className The class name to load and to instantiate.
* @return The new instance of the class name.
- * @throws TilesException If something goes wrong during instantiation.
+ * @throws CannotInstantiateObjectException If something goes wrong during
+ * instantiation.
*/
- public static Object instantiate(String className) throws TilesException {
+ public static Object instantiate(String className) {
return instantiate(className, false);
}
@@ -57,10 +55,9 @@
* returns <code>true</code>, otherwise it throws a
* <code>TilesException</code>.
* @return The new instance of the class name.
- * @throws TilesException If something goes wrong during instantiation.
+ * @throws CannotInstantiateObjectException If something goes wrong during instantiation.
*/
- public static Object instantiate(String className, boolean returnNull)
- throws TilesException {
+ public static Object instantiate(String className, boolean returnNull) {
ClassLoader original = Thread.currentThread().getContextClassLoader();
if (original == null) {
Thread.currentThread().setContextClassLoader(ClassUtil.class.getClassLoader());
@@ -72,12 +69,17 @@
if (returnNull) {
return null;
}
- throw new TilesException("Unable to resolve factory class: '" + className + "'");
+ throw new CannotInstantiateObjectException(
+ "Unable to resolve factory class: '" + className + "'", e);
} catch (IllegalAccessException e) {
- throw new TilesException("Unable to access factory class: '" + className + "'");
+ throw new CannotInstantiateObjectException(
+ "Unable to access factory class: '" + className + "'", e);
} catch (InstantiationException e) {
- throw new TilesException("Unable to instantiate factory class: '"
- + className + "'. Make sure that this class has a default constructor");
+ throw new CannotInstantiateObjectException(
+ "Unable to instantiate factory class: '"
+ + className
+ + "'. Make sure that this class has a default constructor",
+ e);
} finally {
Thread.currentThread().setContextClassLoader(original);
}
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/startup/TilesListener.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/startup/TilesListener.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/startup/TilesListener.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/startup/TilesListener.java Sat Mar 15 08:48:38 2008
@@ -53,13 +53,8 @@
*/
public void contextInitialized(ServletContextEvent event) {
ServletContext servletContext = event.getServletContext();
- try {
- TilesContainer container = createContainer(servletContext);
- TilesAccess.setContainer(servletContext, container);
- } catch (TilesException e) {
- throw new IllegalStateException("Unable to instantiate container.",
- e);
- }
+ TilesContainer container = createContainer(servletContext);
+ TilesAccess.setContainer(servletContext, container);
}
/**
@@ -72,7 +67,7 @@
try {
TilesAccess.setContainer(servletContext, null);
} catch (TilesException e) {
- LOG.warn("Unable to remove tiles container from service.");
+ LOG.warn("Unable to remove tiles container from service.", e);
}
}
@@ -81,10 +76,8 @@
*
* @param context The servlet context to use.
* @return The created container
- * @throws TilesException If something goes wrong during creation.
*/
- protected TilesContainer createContainer(ServletContext context)
- throws TilesException {
+ protected TilesContainer createContainer(ServletContext context) {
TilesContainerFactory factory =
TilesContainerFactory.getFactory(context);
return factory.createContainer(context);
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/util/TilesDecorationFilter.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/util/TilesDecorationFilter.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/util/TilesDecorationFilter.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/util/TilesDecorationFilter.java Sat Mar 15 08:48:38 2008
@@ -25,7 +25,6 @@
import org.apache.tiles.Attribute;
import org.apache.tiles.AttributeContext;
import org.apache.tiles.TilesContainer;
-import org.apache.tiles.TilesException;
import org.apache.tiles.access.TilesAccess;
import javax.servlet.Filter;
@@ -214,16 +213,11 @@
TilesContainer container = TilesAccess.getContainer(getServletContext());
mutator.mutate(container.getAttributeContext(req, res), req);
- try {
- if (preventDecorationToken != null) {
- req.setAttribute(preventDecorationToken, Boolean.TRUE);
- }
- String definitionName = getDefinitionForRequest(req);
- container.render(definitionName, req, res);
- } catch (TilesException e) {
- throw new ServletException("Error wrapping jsp with tile definition. "
- + e.getMessage(), e);
+ if (preventDecorationToken != null) {
+ req.setAttribute(preventDecorationToken, Boolean.TRUE);
}
+ String definitionName = getDefinitionForRequest(req);
+ container.render(definitionName, req, res);
}
/**
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/util/TilesDispatchServlet.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/util/TilesDispatchServlet.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/util/TilesDispatchServlet.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/web/util/TilesDispatchServlet.java Sat Mar 15 08:48:38 2008
@@ -23,7 +23,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tiles.TilesContainer;
-import org.apache.tiles.TilesException;
import org.apache.tiles.AttributeContext;
import org.apache.tiles.access.TilesAccess;
@@ -75,15 +74,11 @@
TilesContainer container = TilesAccess.getContainer(getServletContext());
mutator.mutate(container.getAttributeContext(req, res), req);
- try {
- String definition = getDefinitionName(req);
- if (LOG.isDebugEnabled()) {
- LOG.info("Dispatching to tile '" + definition + "'");
- }
- container.render(definition, req, res);
- } catch (TilesException e) {
- throw new ServletException("Error rendering tile.", e);
+ String definition = getDefinitionName(req);
+ if (LOG.isDebugEnabled()) {
+ LOG.info("Dispatching to tile '" + definition + "'");
}
+ container.render(definition, req, res);
}
/**
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/factory/KeyedDefinitionsFactoryTilesContainerFactoryTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/factory/KeyedDefinitionsFactoryTilesContainerFactoryTest.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/factory/KeyedDefinitionsFactoryTilesContainerFactoryTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/factory/KeyedDefinitionsFactoryTilesContainerFactoryTest.java Sat Mar 15 08:48:38 2008
@@ -28,7 +28,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tiles.TilesContainer;
-import org.apache.tiles.TilesException;
import org.apache.tiles.impl.KeyedDefinitionsFactoryTilesContainer;
import java.util.Map;
@@ -70,10 +69,8 @@
/**
* Tests getting a container factory.
- *
- * @throws TilesException If something goes wrong.
*/
- public void testGetFactory() throws TilesException {
+ public void testGetFactory() {
Vector<String> v = new Vector<String>();
EasyMock.expect(context.getInitParameterNames()).andReturn(v.elements());
@@ -89,11 +86,10 @@
/**
* Tests creating a container.
*
- * @throws TilesException If something goes wrong.
* @throws MalformedURLException If the resources have an invalid form (that
* should not happen).
*/
- public void testCreateContainer() throws TilesException, MalformedURLException {
+ public void testCreateContainer() throws MalformedURLException {
Vector<String> enumeration = new Vector<String>();
EasyMock.expect(context.getInitParameter(TilesContainerFactory.CONTAINER_FACTORY_INIT_PARAM)).andReturn(null);
EasyMock.expect(context.getInitParameter(TilesContainerFactory.CONTEXT_FACTORY_INIT_PARAM)).andReturn(null);
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/factory/TilesContainerFactoryTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/factory/TilesContainerFactoryTest.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/factory/TilesContainerFactoryTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/factory/TilesContainerFactoryTest.java Sat Mar 15 08:48:38 2008
@@ -61,10 +61,8 @@
/**
* Tests getting the factory.
- *
- * @throws TilesException If something goes wrong.
*/
- public void testGetFactory() throws TilesException {
+ public void testGetFactory() {
Vector<String> v = new Vector<String>();
Vector<String> emptyVector = new Vector<String>();
v.add(TilesContainerFactory.CONTAINER_FACTORY_INIT_PARAM);
@@ -116,12 +114,10 @@
/**
* Tests the creation of a container.
*
- * @throws TilesException If something goes wrong during execution of
- * Tiles-specific code.
* @throws MalformedURLException If something goes wrong when obtaining URL
* resources.
*/
- public void testCreateContainer() throws TilesException, MalformedURLException {
+ public void testCreateContainer() throws MalformedURLException {
URL url = getClass().getResource("test-defs.xml");
Vector<String> enumeration = new Vector<String>();
EasyMock.expect(context.getInitParameter(TilesContainerFactory.CONTAINER_FACTORY_INIT_PARAM)).andReturn(null);
@@ -151,10 +147,8 @@
/**
* Tests getting init parameter map.
- *
- * @throws TilesException If something goes wrong.
*/
- public void testGetInitParameterMap() throws TilesException {
+ public void testGetInitParameterMap() {
Vector<String> keys = new Vector<String>();
keys.add("one");
keys.add("two");
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/BasicTilesContainerTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/BasicTilesContainerTest.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/BasicTilesContainerTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/BasicTilesContainerTest.java Sat Mar 15 08:48:38 2008
@@ -86,12 +86,8 @@
e);
}
EasyMock.replay(context);
- try {
- TilesContainerFactory factory = TilesContainerFactory.getFactory(context);
- container = (BasicTilesContainer) factory.createContainer(context);
- } catch (TilesException e) {
- throw new RuntimeException("Error initializing factory", e);
- }
+ TilesContainerFactory factory = TilesContainerFactory.getFactory(context);
+ container = (BasicTilesContainer) factory.createContainer(context);
}
/**
@@ -131,10 +127,9 @@
/**
* Tests is attributes are rendered correctly according to users roles.
*
- * @throws TilesException If a problem arises during rendering.
* @throws IOException If a problem arises during rendering or writing in the writer.
*/
- public void testAttributeCredentials() throws TilesException, IOException {
+ public void testAttributeCredentials() throws IOException {
RoleMockHttpServletRequest request = new RoleMockHttpServletRequest("myrole");
MockHttpSession session = new MockHttpSession();
request.setHttpSession(session);
@@ -156,10 +151,8 @@
/**
* Tests {@link BasicTilesContainer#evaluate(Attribute, Object...)}.
- *
- * @throws TilesException If something goes wrong.
*/
- public void testEvaluate() throws TilesException {
+ public void testEvaluate() {
MockHttpServletRequest request = new MockHttpServletRequest();
MockHttpSession session = new MockHttpSession();
request.setHttpSession(session);
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainerTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainerTest.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainerTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainerTest.java Sat Mar 15 08:48:38 2008
@@ -33,7 +33,6 @@
import junit.framework.TestCase;
-import org.apache.tiles.TilesException;
import org.apache.tiles.definition.DefinitionsFactory;
import org.apache.tiles.factory.KeyedDefinitionsFactoryTilesContainerFactory;
import org.apache.tiles.factory.TilesContainerFactory;
@@ -100,12 +99,8 @@
e);
}
EasyMock.replay(context);
- try {
- TilesContainerFactory factory = TilesContainerFactory.getFactory(context, defaults);
- container = (KeyedDefinitionsFactoryTilesContainer) factory.createContainer(context);
- } catch (TilesException e) {
- throw new RuntimeException("Error initializing factory", e);
- }
+ TilesContainerFactory factory = TilesContainerFactory.getFactory(context, defaults);
+ container = (KeyedDefinitionsFactoryTilesContainer) factory.createContainer(context);
}
/**
@@ -125,9 +120,8 @@
*
* @throws MalformedURLException If sources are not valid (that should not
* happen).
- * @throws TilesException If something goes wrong.
*/
- public void testPostponedDefinitionsFactoryInitialization() throws MalformedURLException, TilesException {
+ public void testPostponedDefinitionsFactoryInitialization() throws MalformedURLException {
KeyedDefinitionsFactoryTilesContainer container;
ServletContext context = EasyMock.createMock(ServletContext.class);
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/preparer/BasicPreparerFactoryTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/preparer/BasicPreparerFactoryTest.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/preparer/BasicPreparerFactoryTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/preparer/BasicPreparerFactoryTest.java Sat Mar 15 08:48:38 2008
@@ -21,7 +21,6 @@
package org.apache.tiles.preparer;
import junit.framework.TestCase;
-import org.apache.tiles.TilesException;
/**
* Tests the basic preparer factory.
@@ -43,10 +42,8 @@
/**
* Tests getting a preparer.
- *
- * @throws TilesException If something goes wrong.
*/
- public void testGetPreparer() throws TilesException {
+ public void testGetPreparer() {
String name = ViewPreparerSupport.class.getName();
ViewPreparer p = factory.getPreparer(name, null);
assertNotNull(p);
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/AbstractBaseAttributeRendererTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/AbstractBaseAttributeRendererTest.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/AbstractBaseAttributeRendererTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/AbstractBaseAttributeRendererTest.java Sat Mar 15 08:48:38 2008
@@ -28,7 +28,6 @@
import org.apache.tiles.Attribute;
import org.apache.tiles.TilesApplicationContext;
-import org.apache.tiles.TilesException;
import org.apache.tiles.context.TilesContextFactory;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.evaluator.impl.DirectAttributeEvaluator;
@@ -84,9 +83,8 @@
* {@link AbstractBaseAttributeRenderer#render(Attribute, Writer, Object...)}.
*
* @throws IOException If something goes wrong during rendition.
- * @throws TilesException If something goes wrong during the usage of Tiles.
*/
- public void testRender() throws IOException, TilesException {
+ public void testRender() throws IOException {
Attribute attribute = new Attribute();
StringWriter writer = new StringWriter();
TilesApplicationContext applicationContext = EasyMock
@@ -163,7 +161,7 @@
@Override
public void write(Object value, Attribute attribute,
Writer writer, TilesRequestContext request, Object... requestItems)
- throws IOException, TilesException {
+ throws IOException {
writer.write("wrote");
}
}
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/BasicRendererFactoryTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/BasicRendererFactoryTest.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/BasicRendererFactoryTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/BasicRendererFactoryTest.java Sat Mar 15 08:48:38 2008
@@ -25,7 +25,6 @@
import org.apache.tiles.TilesApplicationContext;
import org.apache.tiles.TilesContainer;
-import org.apache.tiles.TilesException;
import org.apache.tiles.context.TilesContextFactory;
import org.apache.tiles.renderer.AttributeRenderer;
import org.easymock.EasyMock;
@@ -63,10 +62,8 @@
/**
* Tests {@link BasicRendererFactory#init(Map)} and
* {@link BasicRendererFactory#getRenderer(String)}.
- *
- * @throws TilesException If something goes wrong.
*/
- public void testInitAndGetRenderer() throws TilesException {
+ public void testInitAndGetRenderer() {
Map<String, String> params = new HashMap<String, String>();
params.put(BasicRendererFactory.TYPE_RENDERERS_INIT_PARAM, "test,"
+ StringAttributeRenderer.class.getName());
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java Sat Mar 15 08:48:38 2008
@@ -26,7 +26,6 @@
import org.apache.tiles.Attribute;
import org.apache.tiles.TilesApplicationContext;
import org.apache.tiles.TilesContainer;
-import org.apache.tiles.TilesException;
import org.apache.tiles.context.TilesContextFactory;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.evaluator.impl.DirectAttributeEvaluator;
@@ -58,9 +57,8 @@
* {@link StringAttributeRenderer#write(Object, Attribute, java.io.Writer, TilesRequestContext, Object...)}.
*
* @throws IOException If something goes wrong during rendition.
- * @throws TilesException If something goes wrong during the usage of Tiles.
*/
- public void testWrite() throws IOException, TilesException {
+ public void testWrite() throws IOException {
StringWriter writer = new StringWriter();
Attribute attribute = new Attribute("my.definition", null, "definition");
TilesApplicationContext applicationContext = EasyMock
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/StringAttributeRendererTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/StringAttributeRendererTest.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/StringAttributeRendererTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/StringAttributeRendererTest.java Sat Mar 15 08:48:38 2008
@@ -25,7 +25,6 @@
import org.apache.tiles.Attribute;
import org.apache.tiles.TilesApplicationContext;
-import org.apache.tiles.TilesException;
import org.apache.tiles.context.TilesContextFactory;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.evaluator.impl.DirectAttributeEvaluator;
@@ -57,9 +56,8 @@
* {@link StringAttributeRenderer#write(Object, Attribute, java.io.Writer, TilesRequestContext, Object...)}.
*
* @throws IOException If something goes wrong during rendition.
- * @throws TilesException If something goes wrong during the usage of Tiles.
*/
- public void testWrite() throws IOException, TilesException {
+ public void testWrite() throws IOException {
StringWriter writer = new StringWriter();
Attribute attribute = new Attribute("Result", null, "string");
TilesApplicationContext applicationContext = EasyMock
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/TemplateAttributeRendererTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/TemplateAttributeRendererTest.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/TemplateAttributeRendererTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/TemplateAttributeRendererTest.java Sat Mar 15 08:48:38 2008
@@ -25,7 +25,6 @@
import org.apache.tiles.Attribute;
import org.apache.tiles.TilesApplicationContext;
-import org.apache.tiles.TilesException;
import org.apache.tiles.context.TilesContextFactory;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.evaluator.impl.DirectAttributeEvaluator;
@@ -57,9 +56,8 @@
* {@link StringAttributeRenderer#write(Object, Attribute, java.io.Writer, TilesRequestContext, Object...)}.
*
* @throws IOException If something goes wrong during rendition.
- * @throws TilesException If something goes wrong during the usage of Tiles.
*/
- public void testWrite() throws IOException, TilesException {
+ public void testWrite() throws IOException {
StringWriter writer = new StringWriter();
Attribute attribute = new Attribute("/myTemplate.jsp", null, "template");
TilesApplicationContext applicationContext = EasyMock
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/UntypedAttributeRendererTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/UntypedAttributeRendererTest.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/UntypedAttributeRendererTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/UntypedAttributeRendererTest.java Sat Mar 15 08:48:38 2008
@@ -26,7 +26,6 @@
import org.apache.tiles.Attribute;
import org.apache.tiles.TilesApplicationContext;
import org.apache.tiles.TilesContainer;
-import org.apache.tiles.TilesException;
import org.apache.tiles.context.TilesContextFactory;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.evaluator.impl.DirectAttributeEvaluator;
@@ -59,9 +58,8 @@
* writing a Definition.
*
* @throws IOException If something goes wrong during rendition.
- * @throws TilesException If something goes wrong during the usage of Tiles.
*/
- public void testWriteDefinition() throws IOException, TilesException {
+ public void testWriteDefinition() throws IOException {
StringWriter writer = new StringWriter();
Attribute attribute = new Attribute("my.definition", null, "definition");
TilesApplicationContext applicationContext = EasyMock
@@ -91,9 +89,8 @@
* writing a string.
*
* @throws IOException If something goes wrong during rendition.
- * @throws TilesException If something goes wrong during the usage of Tiles.
*/
- public void testWriteString() throws IOException, TilesException {
+ public void testWriteString() throws IOException {
StringWriter writer = new StringWriter();
Attribute attribute = new Attribute("Result", null, "string");
TilesApplicationContext applicationContext = EasyMock
@@ -122,9 +119,8 @@
* writing a template.
*
* @throws IOException If something goes wrong during rendition.
- * @throws TilesException If something goes wrong during the usage of Tiles.
*/
- public void testWriteTemplate() throws IOException, TilesException {
+ public void testWriteTemplate() throws IOException {
StringWriter writer = new StringWriter();
Attribute attribute = new Attribute("/myTemplate.jsp", null, "template");
TilesApplicationContext applicationContext = EasyMock
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTag.java Sat Mar 15 08:48:38 2008
@@ -21,12 +21,9 @@
package org.apache.tiles.jsp.taglib;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.apache.tiles.jsp.taglib.definition.DefinitionTagParent;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.tagext.TagSupport;
@@ -62,11 +59,6 @@
public class AddAttributeTag extends BodyTagSupport implements DefinitionTagParent {
/**
- * The logging object.
- */
- private static final Log LOG = LogFactory.getLog(AddAttributeTag.class);
-
- /**
* The role to check. If the user is in the specified role, the tag is taken
* into account; otherwise, the tag is ignored (skipped).
*/
@@ -174,9 +166,8 @@
* Save the body content of this tag (if any).
*
* @return It returns <code>SKIP_BODY</code>.
- * @throws JspException if a JSP exception has occurred
*/
- public int doAfterBody() throws JspException {
+ public int doAfterBody() {
if (value == null && bodyContent != null) {
value = bodyContent.getString();
type = "string";
@@ -185,7 +176,7 @@
}
/** {@inheritDoc} */
- public int doEndTag() throws JspException {
+ public int doEndTag() throws TilesJspException {
if (isAccessAllowed()) {
execute();
}
@@ -194,8 +185,7 @@
}
/** {@inheritDoc} */
- public void processNestedDefinitionName(String definitionName)
- throws JspException {
+ public void processNestedDefinitionName(String definitionName) {
value = definitionName;
if (type == null) {
type = "definition";
@@ -203,16 +193,14 @@
}
/** {@inheritDoc} */
- protected void execute() throws JspException {
+ protected void execute() throws TilesJspException {
AddAttributeTagParent parent = (AddAttributeTagParent)
TagSupport.findAncestorWithClass(this, AddAttributeTagParent.class);
if (parent == null) {
- String message = "Error: enclosing tag '"
+ throw new TilesJspException("Error: enclosing tag '"
+ getParent().getClass().getName()
- + " doesn't accept 'put' tag.";
- LOG.error(message);
- throw new JspException(message);
+ + " doesn't accept 'put' tag.");
}
parent.processNestedTag(this);
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTagParent.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTagParent.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTagParent.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTagParent.java Sat Mar 15 08:48:38 2008
@@ -21,8 +21,6 @@
package org.apache.tiles.jsp.taglib;
-import javax.servlet.jsp.JspException;
-
/**
* Tag classes implementing this interface can contain nested {@link AddAttributeTag}.
* This interface defines a method called by nested tags.
@@ -34,8 +32,8 @@
* Process the nested tag.
*
* @param nestedTag Nested tag to process.
- * @throws JspException If something goes wrong during processing.
+ * @throws TilesJspException If something goes wrong during processing.
*/
- void processNestedTag(AddAttributeTag nestedTag) throws JspException;
+ void processNestedTag(AddAttributeTag nestedTag) throws TilesJspException;
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java Sat Mar 15 08:48:38 2008
@@ -26,8 +26,6 @@
import java.util.ArrayList;
import java.util.List;
-import javax.servlet.jsp.JspException;
-
/**
* AddListAttribute tag implementation.
*
@@ -54,18 +52,17 @@
}
/** {@inheritDoc} */
- public int doStartTag() throws JspException {
+ public int doStartTag() {
super.setValue(new ArrayList<Attribute>());
- return super.doStartTag();
+ return EVAL_BODY_BUFFERED;
}
/**
* PutListAttributeTag may not have any body, except for PutAttribute tags.
*
* @return <code>SKIP_BODY</code>.
- * @throws JspException if a JSP exception has occurred
*/
- public int doAfterBody() throws JspException {
+ public int doAfterBody() {
return (SKIP_BODY);
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AttributeTagSupport.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AttributeTagSupport.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AttributeTagSupport.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AttributeTagSupport.java Sat Mar 15 08:48:38 2008
@@ -28,7 +28,6 @@
import org.apache.tiles.TilesException;
import org.apache.tiles.access.TilesAccess;
-import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.TagSupport;
import java.io.IOException;
@@ -133,7 +132,7 @@
}
/** {@inheritDoc} */
- public int doStartTag() throws JspException {
+ public int doStartTag() throws TilesJspException {
container = TilesAccess.getContainer(pageContext.getServletContext());
attributeContext = container.getAttributeContext(pageContext);
scope = getScopeId();
@@ -147,30 +146,30 @@
}
if (attribute == null) {
- throw new JspException("Attribute with name '" + name + "' not found");
+ throw new TilesJspException("Attribute with name '" + name
+ + "' not found");
}
try {
attributeValue = container.evaluate(attribute, pageContext);
} catch (TilesException e) {
if (!ignore) {
- throw new JspException("Attribute with name '" + name
- + "' has a value of '" + attribute.getValue()
- + "' that cannot be evaluated");
+ throw e;
} else if (LOG.isDebugEnabled()) {
LOG.debug("Ignoring Tiles Exception", e);
}
}
if (attributeValue == null) {
- throw new JspException("Attribute with name '" + name + "' has a null value.");
+ throw new TilesJspException("Attribute with name '" + name
+ + "' has a null value.");
}
}
try {
execute();
} catch (IOException e) {
- throw new JspException("io error while executing tag '"
+ throw new TilesJspException("io error while executing tag '"
+ getClass().getName() + "'.", e);
}
@@ -180,10 +179,10 @@
/**
* Execute this tag. It is called inside {@link #doEndTag()}.
*
- * @throws JspException If something goes wrong during rendering.
+ * @throws TilesJspException If something goes wrong during rendering.
* @throws IOException If something goes wrong during writing content.
*/
- public abstract void execute() throws JspException, IOException;
+ public abstract void execute() throws TilesJspException, IOException;
/** {@inheritDoc} */
public int doEndTag() {
@@ -194,9 +193,9 @@
* Get scope value from string value.
*
* @return Scope as an <code>int</code>, or <code>defaultValue</code> if scope is <code>null</code>.
- * @throws javax.servlet.jsp.JspException Scope name is not recognized as a valid scope.
+ * @throws TilesJspException Scope name is not recognized as a valid scope.
*/
- public int getScopeId() throws JspException {
+ public int getScopeId() throws TilesJspException {
if (scopeName == null) {
return PageContext.PAGE_SCOPE;
}
@@ -210,13 +209,14 @@
* @param scopeName Can be "page", "request", "session", or "application" in any
* case.
* @return The constant representing the scope (ie. PageContext.REQUEST_SCOPE).
- * @throws JspException if the scopeName is not a valid name.
+ * @throws TilesJspException if the scopeName is not a valid name.
*/
- public static int getScope(String scopeName) throws JspException {
+ public static int getScope(String scopeName) throws TilesJspException {
Integer scope = SCOPES.get(scopeName.toLowerCase());
if (scope == null) {
- throw new JspException("Unable to retrieve the scope " + scopeName);
+ throw new TilesJspException("Unable to retrieve the scope "
+ + scopeName);
}
return scope;
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ContainerTagSupport.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ContainerTagSupport.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ContainerTagSupport.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ContainerTagSupport.java Sat Mar 15 08:48:38 2008
@@ -26,7 +26,6 @@
import org.apache.tiles.TilesContainer;
import org.apache.tiles.access.TilesAccess;
-import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
/**
@@ -62,21 +61,21 @@
* call <code>super.doStartTag()</code>
*
* @return <code>EVAL_BODY_BUFFERED</code>.
- * @throws JspException If the container has not been initialized.
+ * @throws TilesJspException If the container has not been initialized.
*/
- public int doStartTag() throws JspException {
+ public int doStartTag() throws TilesJspException {
container = TilesAccess.getContainer(pageContext.getServletContext());
if (container != null) {
startContext(pageContext);
return EVAL_BODY_BUFFERED;
} else {
- throw new JspException("TilesContainer not initialized");
+ throw new TilesJspException("TilesContainer not initialized");
}
}
/** {@inheritDoc} */
- public int doEndTag() throws JspException {
+ public int doEndTag() throws TilesJspException {
try {
return super.doEndTag();
} finally {
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java Sat Mar 15 08:48:38 2008
@@ -21,7 +21,6 @@
package org.apache.tiles.jsp.taglib;
import org.apache.tiles.Attribute;
-import org.apache.tiles.TilesException;
import java.io.IOException;
@@ -36,8 +35,7 @@
/** {@inheritDoc} */
@Override
- protected void render(Attribute attr)
- throws TilesException, IOException {
+ protected void render(Attribute attr) throws IOException {
pageContext.getOut().print(attr.getValue().toString());
}
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java Sat Mar 15 08:48:38 2008
@@ -25,8 +25,6 @@
import org.apache.tiles.Attribute;
import org.apache.tiles.TilesException;
-import javax.servlet.jsp.JspException;
-
import java.util.Collection;
@@ -77,9 +75,9 @@
/**
* Expose the requested property from attribute context.
*
- * @throws JspException On errors processing tag.
+ * @throws TilesJspException On errors processing tag.
*/
- public void execute() throws JspException {
+ public void execute() throws TilesJspException {
if (attributeValue != null) {
pageContext.setAttribute(toName != null ? toName : name,
attributeValue, scope);
@@ -93,16 +91,17 @@
* Imports an attribute set.
*
* @param names The names of the attributes to be imported.
- * @throws JspException If something goes wrong during the import.
+ * @throws TilesJspException If something goes wrong during the import.
*/
- private void importAttributes(Collection<String> names) throws JspException {
+ private void importAttributes(Collection<String> names)
+ throws TilesJspException {
if (names == null || names.isEmpty()) {
return;
}
for (String name : names) {
if (name == null && !ignore) {
- throw new JspException("Error importing attributes. "
+ throw new TilesJspException("Error importing attributes. "
+ "Attribute with null key found.");
} else if (name == null) {
continue;
@@ -114,21 +113,20 @@
try {
Object attributeValue = container.evaluate(attr, pageContext);
if (attributeValue == null) {
- throw new JspException("Error importing attributes. "
- + "Attribute '" + name + "' has a null value ");
+ throw new TilesJspException(
+ "Error importing attributes. " + "Attribute '"
+ + name + "' has a null value ");
}
pageContext.setAttribute(name, attributeValue, scope);
} catch (TilesException e) {
if (!ignore) {
- throw new JspException("Attribute with name '" + name
- + "' has a value of '" + attr.getValue()
- + "' that cannot be evaluated");
+ throw e;
} else if (LOG.isDebugEnabled()) {
LOG.debug("Ignoring Tiles Exception", e);
}
}
} else if (!ignore) {
- throw new JspException("Error importing attributes. "
+ throw new TilesJspException("Error importing attributes. "
+ "Attribute '" + name + "' is null");
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java Sat Mar 15 08:48:38 2008
@@ -23,10 +23,8 @@
import org.apache.tiles.Attribute;
import org.apache.tiles.AttributeContext;
-import org.apache.tiles.TilesException;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import java.io.IOException;
@@ -99,7 +97,7 @@
}
/** {@inheritDoc} */
- protected void render() throws JspException, TilesException, IOException {
+ protected void render() throws TilesJspException, IOException {
HttpServletRequest req = (HttpServletRequest) pageContext.getRequest();
// Checks if the attribute can be rendered with the current user.
@@ -117,9 +115,9 @@
if (attr == null) {
if (name != null) {
- throw new TilesException("Attribute '" + name + "' not found.");
+ throw new TilesJspException("Attribute '" + name + "' not found.");
} else {
- throw new TilesException("No attribute name or value has been provided.");
+ throw new TilesJspException("No attribute name or value has been provided.");
}
}
render(attr);
@@ -139,12 +137,10 @@
* Renders an attribute for real.
*
* @param attr The attribute to render.
- * @throws TilesException If something goes wrong during rendering.
* @throws IOException If something goes wrong during the reading of
* definition files.
*/
- protected void render(Attribute attr)
- throws TilesException, IOException {
+ protected void render(Attribute attr) throws IOException {
container.render(attr, pageContext.getOut(), pageContext);
}
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertDefinitionTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertDefinitionTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertDefinitionTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertDefinitionTag.java Sat Mar 15 08:48:38 2008
@@ -21,10 +21,6 @@
package org.apache.tiles.jsp.taglib;
-import org.apache.tiles.TilesException;
-
-import javax.servlet.jsp.JspException;
-
/**
* This is the tag handler for <tiles:insertDefinition>, which includes a
* name, eventually overriding or filling attributes of its template.
@@ -67,7 +63,7 @@
/** {@inheritDoc} */
@Override
- protected void renderContext() throws JspException, TilesException {
+ protected void renderContext() {
container.render(name, pageContext);
}
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java Sat Mar 15 08:48:38 2008
@@ -23,11 +23,8 @@
import java.io.IOException;
-import org.apache.tiles.TilesException;
import org.apache.tiles.jsp.context.JspUtil;
-import javax.servlet.jsp.JspException;
-
/**
* This is the tag handler for <tiles:insertTemplate>, which includes a
* template ready to be filled.
@@ -68,7 +65,7 @@
/** {@inheritDoc} */
@Override
- protected void render() throws JspException, TilesException, IOException {
+ protected void render() throws IOException {
attributeContext.setTemplate(template);
attributeContext.setPreparer(preparer);
attributeContext.setRole(role);
@@ -78,12 +75,9 @@
/**
* Renders the current context.
*
- * @throws TilesException if a prepare or render exception occurs.
- * @throws JspException if a jsp exception occurs.
* @throws IOException if an io exception occurs.
*/
- protected void renderContext() throws JspException, TilesException,
- IOException {
+ protected void renderContext() throws IOException {
JspUtil.setForceInclude(pageContext, true);
container.renderContext(pageContext);
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTag.java Sat Mar 15 08:48:38 2008
@@ -24,7 +24,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
/**
@@ -134,7 +133,7 @@
}
/** {@inheritDoc} */
- protected void execute() throws JspException {
+ protected void execute() throws TilesJspException {
PutAttributeTagParent parent = (PutAttributeTagParent)
TagSupport.findAncestorWithClass(this, PutAttributeTagParent.class);
@@ -144,7 +143,7 @@
+ getParent().getClass().getName()
+ " doesn't accept 'put' tag.";
LOG.error(message);
- throw new JspException(message);
+ throw new TilesJspException(message);
}
parent.processNestedTag(this);
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTagParent.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTagParent.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTagParent.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTagParent.java Sat Mar 15 08:48:38 2008
@@ -22,8 +22,6 @@
package org.apache.tiles.jsp.taglib;
-import javax.servlet.jsp.JspException;
-
/**
* Tag classes implementing this interface can contain nested {@link PutAttributeTag}.
* This interface defines a method called by nested tags.
@@ -35,8 +33,8 @@
* Process the nested tag.
*
* @param nestedTag Nested tag to process.
- * @throws JspException If something goes wrong during processing.
+ * @throws TilesJspException If something goes wrong during processing.
*/
- void processNestedTag(PutAttributeTag nestedTag) throws JspException;
+ void processNestedTag(PutAttributeTag nestedTag) throws TilesJspException;
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java Sat Mar 15 08:48:38 2008
@@ -26,8 +26,6 @@
import java.util.ArrayList;
import java.util.List;
-import javax.servlet.jsp.JspException;
-
/**
* PutList tag implementation.
*
@@ -55,18 +53,17 @@
/** {@inheritDoc} */
@Override
- public int doStartTag() throws JspException {
+ public int doStartTag() {
super.setValue(new ArrayList<Attribute>());
- return super.doStartTag();
+ return EVAL_BODY_BUFFERED;
}
/**
* PutListAttributeTag may not have any body, except for PutAttribute tags.
*
* @return <code>SKIP_BODY</code>.
- * @throws JspException if a JSP exception has occurred
*/
- public int doAfterBody() throws JspException {
+ public int doAfterBody() {
return (SKIP_BODY);
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java Sat Mar 15 08:48:38 2008
@@ -25,11 +25,9 @@
import org.apache.tiles.Attribute;
import org.apache.tiles.AttributeContext;
import org.apache.tiles.TilesContainer;
-import org.apache.tiles.TilesException;
import org.apache.tiles.access.TilesAccess;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.BodyTagSupport;
@@ -185,18 +183,18 @@
}
/** {@inheritDoc} */
- public int doStartTag() throws JspException {
+ public int doStartTag() throws TilesJspException {
container = TilesAccess.getContainer(pageContext.getServletContext());
if (container != null) {
startContext(pageContext);
return EVAL_BODY_BUFFERED;
} else {
- throw new JspException("TilesContainer not initialized");
+ throw new TilesJspException("TilesContainer not initialized");
}
}
/** {@inheritDoc} */
- public int doEndTag() throws JspException {
+ public int doEndTag() throws TilesJspException {
try {
render();
if (flush) {
@@ -204,14 +202,10 @@
}
return EVAL_PAGE;
- } catch (TilesException e) {
- String message = "Error executing tag: " + e.getMessage();
- LOG.error(message, e);
- throw new JspException(message, e);
} catch (IOException io) {
String message = "IO Error executing tag: " + io.getMessage();
LOG.error(message, io);
- throw new JspException(message, io);
+ throw new TilesJspException(message, io);
} finally {
endContext(pageContext);
}
@@ -221,12 +215,11 @@
* Execute the tag by invoking the preparer, if defined, and then
* rendering.
*
- * @throws TilesException if a prepare or render exception occurs.
- * @throws JspException if a jsp exception occurs.
+ * @throws TilesJspException if a jsp exception occurs.
* @throws IOException if an io exception occurs.
* @deprecated Use {@link #render()}.
*/
- protected void execute() throws TilesException, JspException, IOException {
+ protected void execute() throws TilesJspException, IOException {
if (preparer != null) {
container.prepare(preparer, pageContext);
}
@@ -239,11 +232,10 @@
/**
* Render the specified content.
*
- * @throws TilesException if a prepare or render exception occurs.
- * @throws JspException if a jsp exception occurs.
+ * @throws TilesJspException if a jsp exception occurs.
* @throws IOException if an io exception occurs.
*/
- protected abstract void render() throws JspException, TilesException, IOException;
+ protected abstract void render() throws TilesJspException, IOException;
/**
* Starts the context when entering the tag.
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RoleSecurityTagSupport.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RoleSecurityTagSupport.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RoleSecurityTagSupport.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RoleSecurityTagSupport.java Sat Mar 15 08:48:38 2008
@@ -22,10 +22,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.tiles.TilesException;
import javax.servlet.http.HttpServletRequest;
-import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
import java.io.IOException;
@@ -70,19 +68,15 @@
}
/** {@inheritDoc} */
- public int doEndTag() throws JspException {
+ public int doEndTag() throws TilesJspException {
try {
if (isAccessAllowed()) {
execute();
}
- } catch (TilesException e) {
- String message = "Error executing tag: " + e.getMessage();
- LOG.error(message, e);
- throw new JspException(message, e);
} catch (IOException io) {
String message = "IO Error executing tag: " + io.getMessage();
LOG.error(message, io);
- throw new JspException(message, io);
+ throw new TilesJspException(message, io);
}
return EVAL_PAGE;
@@ -99,11 +93,10 @@
/**
* Executes the tag. It is called inside {@link #doEndTag()}.
*
- * @throws TilesException If something goews wrong during the use of Tiles.
- * @throws JspException If something goes wrong during rendering.
+ * @throws TilesJspException If something goes wrong during rendering.
* @throws IOException If something goes wrong during writing content.
*/
- protected abstract void execute() throws TilesException, JspException, IOException;
+ protected abstract void execute() throws TilesJspException, IOException;
/**
* Checks if the user is inside the specified role.
Added: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/TilesJspException.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/TilesJspException.java?rev=637434&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/TilesJspException.java (added)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/TilesJspException.java Sat Mar 15 08:48:38 2008
@@ -0,0 +1,72 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.tiles.jsp.taglib;
+
+import javax.servlet.jsp.JspException;
+
+/**
+ * Indicates that something went wrong during the use of Tiles in JSP pages.
+ *
+ * @version $Rev$ $Date$
+ * @since 2.1.0
+ */
+public class TilesJspException extends JspException {
+
+ /**
+ * Constructor.
+ *
+ * @since 2.1.0
+ */
+ public TilesJspException() {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param msg The detail message.
+ * @since 2.1.0
+ */
+ public TilesJspException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param rootCause The root cause of the exception.
+ * @since 2.1.0
+ */
+ public TilesJspException(Throwable rootCause) {
+ super(rootCause);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message The detail message.
+ * @param rootCause The root cause of the exception.
+ * @since 2.1.0
+ */
+ public TilesJspException(String message, Throwable rootCause) {
+ super(message, rootCause);
+ }
+
+}
Propchange: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/TilesJspException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/TilesJspException.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/UseAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/UseAttributeTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/UseAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/UseAttributeTag.java Sat Mar 15 08:48:38 2008
@@ -22,7 +22,6 @@
package org.apache.tiles.jsp.taglib;
-import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagData;
import javax.servlet.jsp.tagext.TagExtraInfo;
import javax.servlet.jsp.tagext.VariableInfo;
@@ -72,10 +71,8 @@
/**
* Expose the requested attribute from attribute context.
- *
- * @throws JspException if a JSP exception has occurred
*/
- public void execute() throws JspException {
+ public void execute() {
pageContext.setAttribute(getScriptingVariable(), attributeValue, scope);
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java Sat Mar 15 08:48:38 2008
@@ -23,13 +23,12 @@
import org.apache.tiles.Attribute;
import org.apache.tiles.Definition;
import org.apache.tiles.TilesContainer;
-import org.apache.tiles.TilesException;
import org.apache.tiles.jsp.taglib.PutAttributeTag;
import org.apache.tiles.jsp.taglib.PutAttributeTagParent;
+import org.apache.tiles.jsp.taglib.TilesJspException;
import org.apache.tiles.mgmt.MutableTilesContainer;
import org.apache.tiles.access.TilesAccess;
-import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
/**
@@ -181,7 +180,7 @@
}
/** {@inheritDoc} */
- public int doStartTag() throws JspException {
+ public int doStartTag() throws TilesJspException {
definition = new Definition();
definition.setName(name);
definition.setTemplate(template);
@@ -193,10 +192,10 @@
TilesAccess.getContainer(pageContext.getServletContext());
if (c == null) {
- throw new JspException("TilesContainer not initialized");
+ throw new TilesJspException("TilesContainer not initialized");
}
if (!(c instanceof MutableTilesContainer)) {
- throw new JspException(
+ throw new TilesJspException(
"Unable to define definition for a "
+ "container which does not implement MutableTilesContainer");
}
@@ -206,13 +205,9 @@
}
/** {@inheritDoc} */
- public int doEndTag() throws JspException {
- try {
- container.register(definition, pageContext);
- callParent();
- } catch (TilesException e) {
- throw new JspException("Unable to add definition. " , e);
- }
+ public int doEndTag() throws TilesJspException {
+ container.register(definition, pageContext);
+ callParent();
return EVAL_PAGE;
}
@@ -221,9 +216,9 @@
* which invokes TagSupport.release(), which typically does nothing.
*
* @param nestedTag The nested <code>PutAttributeTag</code>
- * @throws JspException Never thrown, it's here for API compatibility.
+ * @throws TilesJspException Never thrown, it's here for API compatibility.
*/
- public void processNestedTag(PutAttributeTag nestedTag) throws JspException {
+ public void processNestedTag(PutAttributeTag nestedTag) throws TilesJspException {
Attribute attr = new Attribute(nestedTag.getValue(),
nestedTag.getRole(), nestedTag.getType());
definition.putAttribute(nestedTag.getName(), attr, nestedTag
@@ -232,10 +227,10 @@
/**
* Find parent tag which must implement {@link DefinitionTagParent}.
- * @throws JspException If we can't find an appropriate enclosing tag.
+ * @throws TilesJspException If we can't find an appropriate enclosing tag.
* @since 2.1.0
*/
- protected void callParent() throws JspException {
+ protected void callParent() throws TilesJspException {
// Get enclosing parent
DefinitionTagParent enclosingParent =
findEnclosingDefinitionTagParent();
@@ -246,18 +241,19 @@
/**
* Find parent tag which must implement AttributeContainer.
- * @throws JspException If we can't find an appropriate enclosing tag.
+ * @throws TilesJspException If we can't find an appropriate enclosing tag.
* @return The parent tag.
* @since 2.1.0
*/
- protected DefinitionTagParent findEnclosingDefinitionTagParent() throws JspException {
+ protected DefinitionTagParent findEnclosingDefinitionTagParent()
+ throws TilesJspException {
try {
DefinitionTagParent parent =
(DefinitionTagParent) findAncestorWithClass(this,
DefinitionTagParent.class);
if (parent == null && name == null) {
- throw new JspException(
+ throw new TilesJspException(
"Error - tag definition : enclosing tag doesn't accept 'definition'"
+ " tag and a name was not specified.");
}
@@ -265,7 +261,7 @@
return parent;
} catch (ClassCastException ex) { // Is it possibile?
- throw new JspException(
+ throw new TilesJspException(
"Error - tag definition : enclosing tag doesn't accept 'definition' tag.", ex);
}
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTagParent.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTagParent.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTagParent.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTagParent.java Sat Mar 15 08:48:38 2008
@@ -20,7 +20,7 @@
*/
package org.apache.tiles.jsp.taglib.definition;
-import javax.servlet.jsp.JspException;
+import org.apache.tiles.jsp.taglib.TilesJspException;
/**
* Tag classes implementing this interface can contain nested
@@ -36,9 +36,9 @@
* Process the nested <tiles:definition> tag.
*
* @param definitionName Nested definition name.
- * @throws JspException If something goes wrong during the processing.
+ * @throws TilesJspException If something goes wrong during the processing.
* @since 2.1.0
*/
void processNestedDefinitionName(String definitionName)
- throws JspException;
+ throws TilesJspException;
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DestroyContainerTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DestroyContainerTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DestroyContainerTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DestroyContainerTag.java Sat Mar 15 08:48:38 2008
@@ -20,10 +20,8 @@
*/
package org.apache.tiles.jsp.taglib.definition;
-import org.apache.tiles.TilesException;
import org.apache.tiles.access.TilesAccess;
-import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
/**
@@ -35,12 +33,8 @@
/** {@inheritDoc} */
@Override
- public int doEndTag() throws JspException {
- try {
- TilesAccess.setContainer(pageContext.getServletContext(), null);
- } catch (TilesException e) {
- throw new JspException(e);
- }
+ public int doEndTag() {
+ TilesAccess.setContainer(pageContext.getServletContext(), null);
return EVAL_PAGE;
}
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/InitContainerTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/InitContainerTag.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/InitContainerTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/InitContainerTag.java Sat Mar 15 08:48:38 2008
@@ -25,7 +25,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.tiles.TilesContainer;
-import org.apache.tiles.TilesException;
import org.apache.tiles.access.TilesAccess;
import org.apache.tiles.factory.TilesContainerFactory;
import org.apache.tiles.jsp.taglib.PutAttributeTag;
@@ -36,7 +35,6 @@
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
-import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyTagSupport;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -93,7 +91,7 @@
/** {@inheritDoc} */
- public void processNestedTag(PutAttributeTag nestedTag) throws JspException {
+ public void processNestedTag(PutAttributeTag nestedTag) {
initParameters.put(nestedTag.getName(), nestedTag.getValue().toString());
}
@@ -112,7 +110,7 @@
/** {@inheritDoc} */
// TODO Add a MutableContainer so that this can be done?
- public int doEndTag() throws JspException {
+ public int doEndTag() {
TilesContainer container =
TilesAccess.getContainer(pageContext.getServletContext());
@@ -134,14 +132,10 @@
context.setInitParameter(entry.getKey(), entry.getValue());
}
- try {
- MutableTilesContainer mutableContainer =
- TilesContainerFactory.getFactory(context)
- .createMutableTilesContainer(context);
- TilesAccess.setContainer(context, mutableContainer);
- } catch (TilesException e) {
- throw new JspException("Error creating tiles container.", e);
- }
+ MutableTilesContainer mutableContainer =
+ TilesContainerFactory.getFactory(context)
+ .createMutableTilesContainer(context);
+ TilesAccess.setContainer(context, mutableContainer);
return EVAL_PAGE;
}
Modified: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/RequestSettingViewPreparer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/RequestSettingViewPreparer.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/RequestSettingViewPreparer.java (original)
+++ tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/RequestSettingViewPreparer.java Sat Mar 15 08:48:38 2008
@@ -20,7 +20,6 @@
*/
package org.apache.tiles.test.preparer;
-import org.apache.tiles.preparer.PreparerException;
import org.apache.tiles.preparer.ViewPreparer;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.AttributeContext;
@@ -28,14 +27,14 @@
/**
* A simple test <code>ViewPreparer</code> to put a request attribute, that
* will be used with the EL evaluator.
- *
+ *
* @version $Rev$ $Date$
*/
public class RequestSettingViewPreparer implements ViewPreparer {
/** {@inheritDoc} */
public void execute(TilesRequestContext tilesContext,
- AttributeContext attributeContext) throws PreparerException {
+ AttributeContext attributeContext) {
tilesContext.getRequestScope().put("body", "test.inner.definition");
tilesContext.getRequestScope().put("layout", "/layout.jsp");
}
Modified: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/renderer/ReverseStringAttributeRenderer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/renderer/ReverseStringAttributeRenderer.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/renderer/ReverseStringAttributeRenderer.java (original)
+++ tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/renderer/ReverseStringAttributeRenderer.java Sat Mar 15 08:48:38 2008
@@ -24,7 +24,6 @@
import java.io.Writer;
import org.apache.tiles.Attribute;
-import org.apache.tiles.TilesException;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.renderer.impl.StringAttributeRenderer;
@@ -39,7 +38,7 @@
@Override
public void write(Object value, Attribute attribute,
Writer writer, TilesRequestContext request, Object... requestItems)
- throws IOException, TilesException {
+ throws IOException {
String original = attribute.getValue().toString();
char[] array = original.toCharArray();
char[] newArray = new char[array.length];
Modified: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/servlet/SelectLocaleServlet.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/servlet/SelectLocaleServlet.java?rev=637434&r1=637433&r2=637434&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/servlet/SelectLocaleServlet.java (original)
+++ tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/servlet/SelectLocaleServlet.java Sat Mar 15 08:48:38 2008
@@ -30,7 +30,6 @@
import javax.servlet.http.HttpSession;
import org.apache.tiles.TilesContainer;
-import org.apache.tiles.TilesException;
import org.apache.tiles.access.TilesAccess;
import org.apache.tiles.locale.impl.DefaultLocaleResolver;
@@ -83,10 +82,6 @@
session.setAttribute(DefaultLocaleResolver.LOCALE_KEY, locale);
TilesContainer container = TilesAccess.getContainer(request
.getSession().getServletContext());
- try {
- container.render("test.localized.definition", request, response);
- } catch (TilesException e) {
- throw new ServletException("Cannot render 'test.localized.definition' definition", e);
- }
+ container.render("test.localized.definition", request, response);
}
}