struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nil...@apache.org
Subject svn commit: r566324 - in /struts/struts2/trunk: apps/portlet/src/main/webapp/WEB-INF/ plugins/portlet/src/main/java/org/apache/struts2/portlet/ plugins/portlet/src/main/java/org/apache/struts2/portlet/result/
Date Wed, 15 Aug 2007 20:14:21 GMT
Author: nilsga
Date: Wed Aug 15 13:14:20 2007
New Revision: 566324

URL: http://svn.apache.org/viewvc?view=rev&rev=566324
Log:
WW-2104 Renamed name of dispatcher servlet and made the name configurable

Modified:
    struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/web.xml
    struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletActionConstants.java
    struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResult.java

Modified: struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/web.xml?view=diff&rev=566324&r1=566323&r2=566324
==============================================================================
--- struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/web.xml (original)
+++ struts/struts2/trunk/apps/portlet/src/main/webapp/WEB-INF/web.xml Wed Aug 15 13:14:20
2007
@@ -25,8 +25,8 @@
 	</listener>
 
 	<!-- Uncomment to use the dispatcher servlet -->
-	<!--<servlet id="dispatcherServlet">
-		<servlet-name>dispatcherServlet</servlet-name>
+	<!--<servlet id="Struts2PortletDispatcherServlet">
+		<servlet-name>Struts2PortletDispatcherServlet</servlet-name>
 		<servlet-class>org.apache.struts2.portlet.dispatcher.DispatcherServlet</servlet-class>
 	</servlet>-->
 	

Modified: struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletActionConstants.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletActionConstants.java?view=diff&rev=566324&r1=566323&r2=566324
==============================================================================
--- struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletActionConstants.java
(original)
+++ struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/PortletActionConstants.java
Wed Aug 15 13:14:20 2007
@@ -125,4 +125,9 @@
 	 * Session key where the value stack from the event phase is stored.
 	 */
 	String STACK_FROM_EVENT_PHASE = "struts.portlet.valueStackFromEventPhase";
+
+	/**
+	 * Default name of dispatcher servlet in web.xml
+	 */
+	String DEFAULT_DISPATCHER_SERVLET_NAME = "Struts2PortletDispatcherServlet";
 }

Modified: struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResult.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResult.java?view=diff&rev=566324&r1=566323&r2=566324
==============================================================================
--- struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResult.java
(original)
+++ struts/struts2/trunk/plugins/portlet/src/main/java/org/apache/struts2/portlet/result/PortletResult.java
Wed Aug 15 13:14:20 2007
@@ -55,6 +55,8 @@
 	private static final long serialVersionUID = 434251393926178567L;
 
 	private boolean useDispatcherServlet;
+	
+	private String dispatcherServletName = DEFAULT_DISPATCHER_SERVLET_NAME;
 
 	/**
 	 * Logger instance.
@@ -176,9 +178,9 @@
 		LOG.debug("Location: " + finalLocation);
 		if (useDispatcherServlet) {
 			req.setAttribute(DISPATCH_TO, finalLocation);
-			PortletRequestDispatcher dispatcher = ctx.getNamedDispatcher("dispatcherServlet");
+			PortletRequestDispatcher dispatcher = ctx.getNamedDispatcher(dispatcherServletName);
 			if(dispatcher == null) {
-				throw new PortletException("Could not locate dispatcherServlet. Please configure it in
your web.xml file");
+				throw new PortletException("Could not locate dispatcher servlet \"" + dispatcherServletName
+ "\". Please configure it in your web.xml file");
 			}
 			dispatcher.include(req, res);
 		} else {
@@ -213,5 +215,10 @@
 	@Inject("struts.portlet.useDispatcherServlet") 
 	public void setUseDispatcherServlet(String useDispatcherServlet) {
 		this.useDispatcherServlet = "true".equalsIgnoreCase(useDispatcherServlet);
+	}
+	
+	@Inject("struts.portlet.dispatcherServletName")
+	public void setDispatcherServletName(String dispatcherServletName) {
+		this.dispatcherServletName = dispatcherServletName;
 	}
 }



Mime
View raw message