You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by do...@apache.org on 2010/10/24 21:02:29 UTC
svn commit: r1026865 [2/2] - in
/incubator/empire-db/trunk/empire-db-struts2: ./
src/main/java/org/apache/empire/struts2/action/
src/main/java/org/apache/empire/struts2/html/
src/main/java/org/apache/empire/struts2/interceptors/
src/main/java/org/apach...
Added: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/UrlHelperEx.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/UrlHelperEx.java?rev=1026865&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/UrlHelperEx.java (added)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/UrlHelperEx.java Sun Oct 24 19:02:28 2010
@@ -0,0 +1,232 @@
+/*
+ * 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.empire.struts2.web;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.apache.commons.lang.xwork.StringUtils;
+import org.apache.struts2.StrutsConstants;
+import org.apache.struts2.views.util.UrlHelper;
+
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.inject.Container;
+
+public class UrlHelperEx extends UrlHelper {
+
+ /**
+ * Default HTTP port (80).
+ */
+ private static final int DEFAULT_HTTP_PORT = 80;
+
+ /**
+ * Default HTTPS port (443).
+ */
+ private static final int DEFAULT_HTTPS_PORT = 443;
+
+ @SuppressWarnings("rawtypes")
+ public static String buildUrl(String action, RequestContext request, ResponseContext response, Map params) {
+ return buildUrl(action, request, response, params, null, true, true);
+ }
+
+ @SuppressWarnings("rawtypes")
+ public static String buildUrl(String action, RequestContext request, ResponseContext response, Map params, String scheme, boolean includeContext, boolean encodeResult) {
+ return buildUrl(action, request, response, params, scheme, includeContext, encodeResult, false);
+ }
+
+ @SuppressWarnings("rawtypes")
+ public static String buildUrl(String action, RequestContext request, ResponseContext response, Map params, String scheme, boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort) {
+ return buildUrl(action, request, response, params, scheme, includeContext, encodeResult, forceAddSchemeHostAndPort, true);
+ }
+
+ @SuppressWarnings("rawtypes")
+ public static String buildUrl(String action, RequestContext request, ResponseContext response, Map params, String scheme, boolean includeContext, boolean encodeResult, boolean forceAddSchemeHostAndPort, boolean escapeAmp) {
+ StringBuilder link = new StringBuilder();
+
+ boolean changedScheme = false;
+
+ // FIXME: temporary hack until class is made a properly injected bean
+ Container cont = ActionContext.getContext().getContainer();
+ int httpPort = Integer.parseInt(cont.getInstance(String.class, StrutsConstants.STRUTS_URL_HTTP_PORT));
+ int httpsPort = Integer.parseInt(cont.getInstance(String.class, StrutsConstants.STRUTS_URL_HTTPS_PORT));
+
+ // only append scheme if it is different to the current scheme *OR*
+ // if we explicity want it to be appended by having forceAddSchemeHostAndPort = true
+ if (forceAddSchemeHostAndPort) {
+ String reqScheme = request.getScheme();
+ changedScheme = true;
+ link.append(scheme != null ? scheme : reqScheme);
+ link.append("://");
+ link.append(request.getServerName());
+
+ if (scheme != null) {
+ // If switching schemes, use the configured port for the particular scheme.
+ if (!scheme.equals(reqScheme)) {
+ if ((scheme.equals("http") && (httpPort != DEFAULT_HTTP_PORT)) || (scheme.equals("https") && httpsPort != DEFAULT_HTTPS_PORT)) {
+ link.append(":");
+ link.append(scheme.equals("http") ? httpPort : httpsPort);
+ }
+ // Else use the port from the current request.
+ } else {
+ int reqPort = request.getServerPort();
+
+ if ((scheme.equals("http") && (reqPort != DEFAULT_HTTP_PORT)) || (scheme.equals("https") && reqPort != DEFAULT_HTTPS_PORT)) {
+ link.append(":");
+ link.append(reqPort);
+ }
+ }
+ }
+ }
+ else if ((scheme != null) && !scheme.equals(request.getScheme())) {
+ changedScheme = true;
+ link.append(scheme);
+ link.append("://");
+ link.append(request.getServerName());
+
+ if ((scheme.equals("http") && (httpPort != DEFAULT_HTTP_PORT)) || (scheme.equals("https") && httpsPort != DEFAULT_HTTPS_PORT))
+ {
+ link.append(":");
+ link.append(scheme.equals("http") ? httpPort : httpsPort);
+ }
+ }
+
+ if (action != null) {
+ // Check if context path needs to be added
+ // Add path to absolute links
+ if (action.startsWith("/") && includeContext) {
+ String contextPath = request.getContextPath();
+ if (!contextPath.equals("/")) {
+ link.append(contextPath);
+ }
+ } else if (changedScheme) {
+
+ // (Applicable to Servlet 2.4 containers)
+ // If the request was forwarded, the attribute below will be set with the original URL
+ String uri = (String) request.getAttribute("javax.servlet.forward.request_uri");
+
+ // If the attribute wasn't found, default to the value in the request object
+ if (uri == null) {
+ uri = request.getRequestURI();
+ }
+
+ link.append(uri.substring(0, uri.lastIndexOf('/') + 1));
+ }
+
+ // Add page
+ link.append(action);
+ } else {
+ // Go to "same page"
+ String requestURI = (String) request.getAttribute("struts.request_uri");
+
+ // (Applicable to Servlet 2.4 containers)
+ // If the request was forwarded, the attribute below will be set with the original URL
+ if (requestURI == null) {
+ requestURI = (String) request.getAttribute("javax.servlet.forward.request_uri");
+ }
+
+ // If neither request attributes were found, default to the value in the request object
+ if (requestURI == null) {
+ requestURI = request.getRequestURI();
+ }
+
+ link.append(requestURI);
+ }
+
+ //if the action was not explicitly set grab the params from the request
+ if (escapeAmp) {
+ buildParametersString(params, link);
+ } else {
+ buildParametersString(params, link, "&");
+ }
+
+ String result = link.toString();
+
+ while (result.indexOf("<script>") > 0){
+ result = result.replaceAll("<script>", "script");
+ }
+ try {
+ result = encodeResult ? response.encodeURL(result) : result;
+ } catch (Exception ex) {
+ // Could not encode the URL for some reason
+ // Use it unchanged
+ result = link.toString();
+ }
+
+ return result;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public static void buildParametersString(Map params, StringBuilder link, String paramSeparator) {
+ if ((params != null) && (params.size() > 0)) {
+ if (link.toString().indexOf("?") == -1) {
+ link.append("?");
+ } else {
+ link.append(paramSeparator);
+ }
+
+ // Set params
+ Iterator iter = params.entrySet().iterator();
+
+
+ while (iter.hasNext()) {
+ Map.Entry entry = (Map.Entry) iter.next();
+ String name = (String) entry.getKey();
+ Object value = entry.getValue();
+
+
+ if (value instanceof Iterable) {
+ for (Iterator iterator = ((Iterable) value).iterator(); iterator
+ .hasNext();) {
+ Object paramValue = iterator.next();
+ link.append(buildParameterSubstring(name, paramValue
+ .toString()));
+
+ if (iterator.hasNext())
+ link.append(paramSeparator);
+ }
+ } else if (value instanceof Object[]) {
+ Object[] array = (Object[]) value;
+ for (int i = 0; i < array.length; i++) {
+ Object paramValue = array[i];
+ link.append(buildParameterSubstring(name, paramValue
+ .toString()));
+
+ if (i < array.length - 1)
+ link.append(paramSeparator);
+ }
+ } else {
+ link.append(buildParameterSubstring(name, value != null ? value.toString() : StringUtils.EMPTY));
+ }
+
+ if (iter.hasNext())
+ link.append(paramSeparator);
+ }
+ }
+ }
+
+ private static String buildParameterSubstring(String name, String value) {
+ StringBuilder builder = new StringBuilder();
+ builder.append(translateAndEncode(name));
+ builder.append('=');
+ builder.append(translateAndEncode(value));
+
+ return builder.toString();
+ }
+
+}
Propchange: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/UrlHelperEx.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebApplication.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebApplication.java?rev=1026865&r1=1026864&r2=1026865&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebApplication.java (original)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebApplication.java Sun Oct 24 19:02:28 2010
@@ -18,11 +18,10 @@
*/
package org.apache.empire.struts2.web;
-import javax.servlet.ServletContext;
public interface WebApplication
{
public final String APPLICATION_NAME = "webApp";
- void init(ServletContext servletContext);
+ void init(AppContext servletContext);
}
Modified: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebRequest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebRequest.java?rev=1026865&r1=1026864&r2=1026865&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebRequest.java (original)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebRequest.java Sun Oct 24 19:02:28 2010
@@ -18,9 +18,6 @@
*/
package org.apache.empire.struts2.web;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
public interface WebRequest
{
/**
@@ -38,19 +35,19 @@ public interface WebRequest
*
* @return true if the request should continue processing or false otherwise
*/
- boolean init(HttpServletRequest request, HttpServletResponse response, Object session);
+ boolean init(RequestContext request, ResponseContext response, Object session);
/**
* returns the current HttpRequestObject
* @return the httpServletRequest
*/
- public HttpServletRequest getHttpRequest();
+ public RequestContext getRequestContext();
/**
* returns the current HttpResponseObject
* @return the httpServletResponse
*/
- public HttpServletResponse getHttpResponse();
+ public ResponseContext getResponseContext();
/**
* This function is called from the EmpireStrutsDispatcher when a request ends
Modified: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebSession.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebSession.java?rev=1026865&r1=1026864&r2=1026865&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebSession.java (original)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/WebSession.java Sun Oct 24 19:02:28 2010
@@ -18,11 +18,10 @@
*/
package org.apache.empire.struts2.web;
-import javax.servlet.http.HttpSession;
public interface WebSession
{
public final String SESSION_NAME = "webSession";
- void init(HttpSession httpSession, Object application);
+ void init(SessionContext session, Object application);
}
Added: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletContextWrapper.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletContextWrapper.java?rev=1026865&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletContextWrapper.java (added)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletContextWrapper.java Sun Oct 24 19:02:28 2010
@@ -0,0 +1,100 @@
+/*
+ * 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.empire.struts2.web.portlet;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Set;
+
+import javax.portlet.PortletContext;
+
+import org.apache.empire.struts2.web.AppContext;
+
+public class PortletContextWrapper implements AppContext {
+
+ private PortletContext ctx;
+ public PortletContextWrapper(PortletContext ctx) {
+ this.ctx = ctx;
+ }
+
+ public String getContextName() {
+ return ctx.getPortletContextName();
+ }
+
+ public Object getExternalContext() {
+ return ctx;
+ }
+
+ public boolean isPortlet() {
+ return true;
+ }
+
+ public String getMimeType(String file) {
+ return ctx.getMimeType(file);
+ }
+
+ public String getRealPath(String path) {
+ return ctx.getRealPath(path);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<String> getResourcePaths(String path) {
+ return ctx.getResourcePaths(path);
+ }
+
+ public URL getResource(String path) throws MalformedURLException {
+ return ctx.getResource(path);
+ }
+
+ public void log(java.lang.String msg) {
+ ctx.log(msg);
+ }
+
+ public void log(java.lang.String message, java.lang.Throwable throwable) {
+ ctx.log(message, throwable);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getInitParameterNames() {
+ return ctx.getInitParameterNames();
+ }
+
+ public String getInitParameter(java.lang.String name) {
+ return ctx.getInitParameter(name);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getAttributeNames() {
+ return ctx.getAttributeNames();
+ }
+
+ public Object getAttribute(java.lang.String name) {
+ return ctx.getAttribute(name);
+ }
+
+ public void removeAttribute(java.lang.String name) {
+ ctx.removeAttribute(name);
+ }
+
+ public void setAttribute(java.lang.String name, java.lang.Object object) {
+ ctx.setAttribute(name, object);
+ }
+
+}
Propchange: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletContextWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletRequestWrapper.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletRequestWrapper.java?rev=1026865&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletRequestWrapper.java (added)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletRequestWrapper.java Sun Oct 24 19:02:28 2010
@@ -0,0 +1,125 @@
+/*
+ * 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.empire.struts2.web.portlet;
+
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.portlet.PortletRequest;
+
+import org.apache.empire.struts2.web.RequestContext;
+import org.apache.empire.struts2.web.SessionContext;
+
+public class PortletRequestWrapper implements RequestContext {
+
+ private PortletRequest req;
+ public PortletRequestWrapper(PortletRequest req) {
+ this.req = req;
+ }
+
+ public Object getExternalRequest(){
+ return req;
+ }
+ public SessionContext getSessionContext(){
+ return new PortletSessionWrapper(req.getPortletSession());
+ }
+
+ public String getRequestURI() {
+ /* Dont't Know how to implement this! */
+ return "";
+ }
+
+ /* Request info */
+ public String getAuthType(){
+ return req.getAuthType();
+ }
+ public String getContextPath(){
+ return req.getContextPath();
+ }
+ public String getRemoteUser(){
+ return req.getRemoteUser();
+ }
+ public Principal getUserPrincipal(){
+ return req.getUserPrincipal();
+ }
+ public boolean isUserInRole(String role){
+ return req.isUserInRole(role);
+ }
+ public boolean isSecure(){
+ return req.isSecure();
+ }
+ public String getScheme(){
+ return req.getScheme();
+ }
+ public String getServerName(){
+ return req.getServerName();
+ }
+ public int getServerPort(){
+ return req.getServerPort();
+ }
+
+ public String getRequestedSessionId(){
+ return req.getRequestedSessionId();
+ }
+ public boolean isRequestedSessionIdValid() {
+ return req.isRequestedSessionIdValid();
+ }
+
+ public Locale getLocale(){
+ return req.getLocale();
+ }
+ @SuppressWarnings("unchecked")
+ public Enumeration<Locale> getLocales(){
+ return req.getLocales();
+ }
+
+ /* Parameter accessors */
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getParameterNames() {
+ return req.getParameterNames();
+ }
+ public String getParameter(String name) {
+ return req.getParameter(name);
+ }
+ public String[] getParameterValues(String name) {
+ return req.getParameterValues(name);
+ }
+ @SuppressWarnings("unchecked")
+ public Map<String,String> getParameterMap() {
+ return req.getParameterMap();
+ }
+
+ /* Attribute accessors */
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getAttributeNames() {
+ return req.getAttributeNames();
+ }
+ public Object getAttribute(String name) {
+ return req.getAttribute(name);
+ }
+ public void setAttribute(String name, Object o) {
+ req.setAttribute(name, o);
+ }
+ public void removeAttribute(String name) {
+ req.removeAttribute(name);
+ }
+
+}
Propchange: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletRequestWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletResponseWrapper.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletResponseWrapper.java?rev=1026865&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletResponseWrapper.java (added)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletResponseWrapper.java Sun Oct 24 19:02:28 2010
@@ -0,0 +1,136 @@
+/*
+ * 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.empire.struts2.web.portlet;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletResponse;
+import javax.portlet.RenderResponse;
+import javax.servlet.http.Cookie;
+
+import org.apache.empire.struts2.web.ResponseContext;
+
+public class PortletResponseWrapper implements ResponseContext {
+
+ private static final String METHOD_NOT_SUPPORTED = "Method not supported";
+
+ private PortletResponse res;
+ public PortletResponseWrapper(PortletResponse res) {
+ this.res = res;
+ }
+
+ public Object getExternalResponse() {
+ return res;
+ }
+
+ // Action methods
+ public void addCookie(Cookie cookie) {
+ res.addProperty(cookie.getName(), cookie.getValue());
+ }
+ public String encodeURL(String url) {
+ return res.encodeURL(url);
+ }
+ public String encodeRedirectURL(String url) {
+ return res.encodeURL(url);
+ }
+ public void sendRedirect(String location) throws IOException {
+ if (res instanceof ActionResponse)
+ ((ActionResponse)res).sendRedirect(location);
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+
+ // Render methods
+ public Locale getLocale() {
+ if (res instanceof RenderResponse)
+ return ((RenderResponse)res).getLocale();
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+ public String getCharacterEncoding() {
+ if (res instanceof RenderResponse)
+ return ((RenderResponse)res).getCharacterEncoding();
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+ public String getContentType() {
+ if (res instanceof RenderResponse)
+ return ((RenderResponse)res).getContentType();
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+ public void setContentType(String type) {
+ if (res instanceof RenderResponse)
+ ((RenderResponse)res).setContentType(type);
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+ public int getBufferSize() {
+ if (res instanceof RenderResponse)
+ return ((RenderResponse)res).getBufferSize();
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+ public void setBufferSize(int size) {
+ if (res instanceof RenderResponse)
+ ((RenderResponse)res).setBufferSize(size);
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+ public PrintWriter getWriter() throws IOException {
+ if (res instanceof RenderResponse)
+ return ((RenderResponse)res).getWriter();
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+ public OutputStream getOutputStream() throws IOException {
+ if (res instanceof RenderResponse)
+ return ((RenderResponse)res).getPortletOutputStream();
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+ public void flushBuffer() throws IOException {
+ if (res instanceof RenderResponse)
+ ((RenderResponse)res).flushBuffer();
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+ public void resetBuffer() {
+ if (res instanceof RenderResponse)
+ ((RenderResponse)res).resetBuffer();
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+ public boolean isCommitted() {
+ if (res instanceof RenderResponse)
+ return ((RenderResponse)res).isCommitted();
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+ public void reset() {
+ if (res instanceof RenderResponse)
+ ((RenderResponse)res).reset();
+ else
+ throw new RuntimeException(METHOD_NOT_SUPPORTED);
+ }
+}
Propchange: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletResponseWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletSessionWrapper.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletSessionWrapper.java?rev=1026865&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletSessionWrapper.java (added)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletSessionWrapper.java Sun Oct 24 19:02:28 2010
@@ -0,0 +1,77 @@
+/*
+ * 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.empire.struts2.web.portlet;
+
+import java.util.Enumeration;
+
+import org.apache.empire.struts2.web.AppContext;
+import org.apache.empire.struts2.web.SessionContext;
+
+public class PortletSessionWrapper implements SessionContext {
+
+ private javax.portlet.PortletSession session;
+ public PortletSessionWrapper(javax.portlet.PortletSession session) {
+ this.session = session;
+ }
+
+ public Object getExternalSession(){
+ return session;
+ }
+ public AppContext getAppContext() {
+ return new PortletContextWrapper(session.getPortletContext());
+ }
+
+ public String getId() {
+ return session.getId();
+ }
+ public boolean isNew() {
+ return session.isNew();
+ }
+ public void invalidate() {
+ session.invalidate();
+ }
+
+ public long getCreationTime() {
+ return session.getCreationTime();
+ }
+ public long getLastAccessedTime() {
+ return session.getLastAccessedTime();
+ }
+ public int getMaxInactiveInterval() {
+ return session.getMaxInactiveInterval();
+ }
+ public void setMaxInactiveInterval(int interval) {
+ session.setMaxInactiveInterval(interval);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getAttributeNames() {
+ return session.getAttributeNames();
+ }
+ public Object getAttribute(String name) {
+ return session.getAttribute(name);
+ }
+ public void setAttribute(String name, Object value) {
+ session.setAttribute(name, value);
+ }
+ public void removeAttribute(String name) {
+ session.removeAttribute(name);
+ }
+
+}
Propchange: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/portlet/PortletSessionWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletContextWrapper.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletContextWrapper.java?rev=1026865&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletContextWrapper.java (added)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletContextWrapper.java Sun Oct 24 19:02:28 2010
@@ -0,0 +1,100 @@
+/*
+ * 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.empire.struts2.web.servlet;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.Set;
+
+import javax.servlet.ServletContext;
+
+import org.apache.empire.struts2.web.AppContext;
+
+public class ServletContextWrapper implements AppContext {
+
+ private ServletContext ctx;
+ public ServletContextWrapper(ServletContext ctx) {
+ this.ctx = ctx;
+ }
+
+ public String getContextName() {
+ return ctx.getServletContextName();
+ }
+
+ public Object getExternalContext() {
+ return ctx;
+ }
+
+ public String getMimeType(String file) {
+ return ctx.getMimeType(file);
+ }
+
+ public boolean isPortlet() {
+ return false;
+ }
+
+ public String getRealPath(String path) {
+ return ctx.getRealPath(path);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<String> getResourcePaths(String path) {
+ return ctx.getResourcePaths(path);
+ }
+
+ public URL getResource(String path) throws MalformedURLException {
+ return ctx.getResource(path);
+ }
+
+ public void log(java.lang.String msg) {
+ ctx.log(msg);
+ }
+
+ public void log(java.lang.String message, java.lang.Throwable throwable) {
+ ctx.log(message, throwable);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getInitParameterNames() {
+ return ctx.getInitParameterNames();
+ }
+
+ public String getInitParameter(java.lang.String name) {
+ return ctx.getInitParameter(name);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getAttributeNames() {
+ return ctx.getAttributeNames();
+ }
+
+ public Object getAttribute(java.lang.String name) {
+ return ctx.getAttribute(name);
+ }
+
+ public void removeAttribute(java.lang.String name) {
+ ctx.removeAttribute(name);
+ }
+
+ public void setAttribute(java.lang.String name, java.lang.Object object) {
+ ctx.setAttribute(name, object);
+ }
+
+}
Propchange: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletContextWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletRequestWrapper.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletRequestWrapper.java?rev=1026865&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletRequestWrapper.java (added)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletRequestWrapper.java Sun Oct 24 19:02:28 2010
@@ -0,0 +1,124 @@
+/*
+ * 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.empire.struts2.web.servlet;
+
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.empire.struts2.web.RequestContext;
+import org.apache.empire.struts2.web.SessionContext;
+
+public class ServletRequestWrapper implements RequestContext {
+
+ private HttpServletRequest req;
+ public ServletRequestWrapper(HttpServletRequest req) {
+ this.req = req;
+ }
+
+ public Object getExternalRequest(){
+ return req;
+ }
+ public SessionContext getSessionContext(){
+ return new ServletSessionWrapper(req.getSession());
+ }
+
+ public String getRequestURI() {
+ return req.getRequestURI();
+ }
+
+ /* Request info */
+ public String getAuthType(){
+ return req.getAuthType();
+ }
+ public String getContextPath(){
+ return req.getContextPath();
+ }
+ public String getRemoteUser(){
+ return req.getRemoteUser();
+ }
+ public Principal getUserPrincipal(){
+ return req.getUserPrincipal();
+ }
+ public boolean isUserInRole(String role){
+ return req.isUserInRole(role);
+ }
+ public boolean isSecure(){
+ return req.isSecure();
+ }
+ public String getScheme(){
+ return req.getScheme();
+ }
+ public String getServerName(){
+ return req.getServerName();
+ }
+ public int getServerPort(){
+ return req.getServerPort();
+ }
+
+ public String getRequestedSessionId(){
+ return req.getRequestedSessionId();
+ }
+ public boolean isRequestedSessionIdValid() {
+ return req.isRequestedSessionIdValid();
+ }
+
+ public Locale getLocale(){
+ return req.getLocale();
+ }
+ @SuppressWarnings("unchecked")
+ public Enumeration<Locale> getLocales(){
+ return req.getLocales();
+ }
+
+ /* Parameter accessors */
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getParameterNames() {
+ return req.getParameterNames();
+ }
+ public String getParameter(String name) {
+ return req.getParameter(name);
+ }
+ public String[] getParameterValues(String name) {
+ return req.getParameterValues(name);
+ }
+ @SuppressWarnings("unchecked")
+ public Map<String,String> getParameterMap() {
+ return req.getParameterMap();
+ }
+
+ /* Attribute accessors */
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getAttributeNames() {
+ return req.getAttributeNames();
+ }
+ public Object getAttribute(String name) {
+ return req.getAttribute(name);
+ }
+ public void setAttribute(String name, Object o) {
+ req.setAttribute(name, o);
+ }
+ public void removeAttribute(String name) {
+ req.removeAttribute(name);
+ }
+
+}
Propchange: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletRequestWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletResponseWrapper.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletResponseWrapper.java?rev=1026865&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletResponseWrapper.java (added)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletResponseWrapper.java Sun Oct 24 19:02:28 2010
@@ -0,0 +1,93 @@
+/*
+ * 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.empire.struts2.web.servlet;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Locale;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.empire.struts2.web.ResponseContext;
+
+public class ServletResponseWrapper implements ResponseContext {
+
+ private HttpServletResponse res;
+ public ServletResponseWrapper(HttpServletResponse res) {
+ this.res = res;
+ }
+
+ public Object getExternalResponse() {
+ return res;
+ }
+
+ // Action methods
+ public void addCookie(Cookie cookie) {
+ res.addCookie(cookie);
+ }
+ public String encodeURL(String url) {
+ return res.encodeURL(url);
+ }
+ public String encodeRedirectURL(String url) {
+ return res.encodeRedirectURL(url);
+ }
+ public void sendRedirect(String location) throws IOException {
+ res.sendRedirect(location);
+ }
+
+ // Render methods
+ public Locale getLocale() {
+ return res.getLocale();
+ }
+ public String getCharacterEncoding() {
+ return res.getCharacterEncoding();
+ }
+ public String getContentType() {
+ return res.getContentType();
+ }
+ public void setContentType(String type) {
+ res.setContentType(type);
+ }
+ public int getBufferSize() {
+ return res.getBufferSize();
+ }
+ public void setBufferSize(int size) {
+ res.setBufferSize(size);
+ }
+ public PrintWriter getWriter() throws IOException {
+ return res.getWriter();
+ }
+ public OutputStream getOutputStream() throws IOException {
+ return res.getOutputStream();
+ }
+ public void flushBuffer() throws IOException {
+ res.flushBuffer();
+ }
+ public void resetBuffer() {
+ res.resetBuffer();
+ }
+ public boolean isCommitted() {
+ return res.isCommitted();
+ }
+ public void reset() {
+ res.reset();
+ }
+}
Propchange: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletResponseWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletSessionWrapper.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletSessionWrapper.java?rev=1026865&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletSessionWrapper.java (added)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletSessionWrapper.java Sun Oct 24 19:02:28 2010
@@ -0,0 +1,79 @@
+/*
+ * 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.empire.struts2.web.servlet;
+
+import java.util.Enumeration;
+
+import javax.servlet.http.HttpSession;
+
+import org.apache.empire.struts2.web.AppContext;
+import org.apache.empire.struts2.web.SessionContext;
+
+public class ServletSessionWrapper implements SessionContext {
+
+ private HttpSession session;
+ public ServletSessionWrapper(HttpSession session) {
+ this.session = session;
+ }
+
+ public Object getExternalSession(){
+ return session;
+ }
+ public AppContext getAppContext() {
+ return new ServletContextWrapper(session.getServletContext());
+ }
+
+ public String getId() {
+ return session.getId();
+ }
+ public boolean isNew() {
+ return session.isNew();
+ }
+ public void invalidate() {
+ session.invalidate();
+ }
+
+ public long getCreationTime() {
+ return session.getCreationTime();
+ }
+ public long getLastAccessedTime() {
+ return session.getLastAccessedTime();
+ }
+ public int getMaxInactiveInterval() {
+ return session.getMaxInactiveInterval();
+ }
+ public void setMaxInactiveInterval(int interval) {
+ session.setMaxInactiveInterval(interval);
+ }
+
+ @SuppressWarnings("unchecked")
+ public Enumeration<String> getAttributeNames() {
+ return session.getAttributeNames();
+ }
+ public Object getAttribute(String name) {
+ return session.getAttribute(name);
+ }
+ public void setAttribute(String name, Object value) {
+ session.setAttribute(name, value);
+ }
+ public void removeAttribute(String name) {
+ session.removeAttribute(name);
+ }
+
+}
Propchange: incubator/empire-db/trunk/empire-db-struts2/src/main/java/org/apache/empire/struts2/web/servlet/ServletSessionWrapper.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/empire-db/trunk/empire-db-struts2/src/main/resources/META-INF/empire-tags.tld
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/resources/META-INF/empire-tags.tld?rev=1026865&r1=1026864&r2=1026865&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/resources/META-INF/empire-tags.tld (original)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/resources/META-INF/empire-tags.tld Sun Oct 24 19:02:28 2010
@@ -21,7 +21,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
- <tlib-version>1.0</tlib-version>
+ <tlib-version>1.1</tlib-version>
<short-name>e</short-name>
<uri>/empire-tags</uri>
<!-- Float Clear Tag -->
@@ -733,6 +733,11 @@
<type>java.lang.String</type>
</attribute>
<attribute>
+ <name>urlType</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<name>item</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -1097,6 +1102,11 @@
<type>java.lang.String</type>
</attribute>
<attribute>
+ <name>urlType</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<name>item</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -1167,6 +1177,11 @@
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
+ <name>urlType</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<name>item</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -1258,6 +1273,11 @@
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
+ <name>urlType</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<name>item</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
@@ -1781,6 +1801,11 @@
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
+ <name>urlType</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<name>item</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
Added: incubator/empire-db/trunk/empire-db-struts2/src/main/resources/struts-empire.xml
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db-struts2/src/main/resources/struts-empire.xml?rev=1026865&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db-struts2/src/main/resources/struts-empire.xml (added)
+++ incubator/empire-db/trunk/empire-db-struts2/src/main/resources/struts-empire.xml Sun Oct 24 19:02:28 2010
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+/*
+ * 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.
+ */
+-->
+<!DOCTYPE struts PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
+ "http://struts.apache.org/dtds/struts-2.1.7.dtd">
+
+<struts>
+
+ <!-- empire-default -->
+ <package name="empire-default" extends="struts-default">
+ <interceptors>
+
+ <!-- org.apache.empire.struts2 Interceptors -->
+ <interceptor name="actionBasics" class="org.apache.empire.struts2.interceptors.ActionBasicsInterceptor" >
+ <param name="errorAction">error</param>
+ </interceptor>
+
+ <!-- org.apache.empire.struts2 Interceptors -->
+ <interceptor name="actionAccess" class="org.apache.empire.struts2.interceptors.ActionAccessInterceptor" >
+ <param name="loginAction">login</param>
+ <!--
+ <param name="accessDeniedAction">login!doAccessDenied</param>
+ -->
+ </interceptor>
+
+ <!-- Empire Default Stack -->
+ <interceptor-stack name="empireDefaultStack">
+ <!-- Empire-Interceptors -->
+ <interceptor-ref name="actionBasics"/>
+ <interceptor-ref name="actionAccess"/>
+ <!-- Struts-Interceptors -->
+ <!--
+ <interceptor-ref name="exception"/>
+ <interceptor-ref name="alias"/>
+ <interceptor-ref name="i18n"/>
+ -->
+ <interceptor-ref name="checkbox"/>
+ <!--
+ <interceptor-ref name="multiselect"/>
+ -->
+ <interceptor-ref name="params">
+ <param name="excludeParams">dojo\..*,^struts\..*</param>
+ </interceptor-ref>
+ <!--
+ <interceptor-ref name="servletConfig"/>
+ <interceptor-ref name="prepare"/>
+ <interceptor-ref name="chain"/>
+ <interceptor-ref name="modelDriven"/>
+ <interceptor-ref name="staticParams"/>
+ <interceptor-ref name="actionMappingParams"/>
+ <interceptor-ref name="params">
+ <param name="excludeParams">dojo\..*,^struts\..*</param>
+ </interceptor-ref>
+ <interceptor-ref name="conversionError"/>
+ <interceptor-ref name="validation">
+ <param name="excludeMethods">input,back,cancel,browse</param>
+ </interceptor-ref>
+ <interceptor-ref name="workflow">
+ <param name="excludeMethods">input,back,cancel,browse</param>
+ </interceptor-ref>
+ -->
+ </interceptor-stack>
+
+ <!-- File upload stack -->
+ <interceptor-stack name="fileUploadStack">
+ <interceptor-ref name="fileUpload"/>
+ <interceptor-ref name="empireDefaultStack"/>
+ </interceptor-stack>
+ </interceptors>
+ <!-- set default stack -->
+ <default-interceptor-ref name="empireDefaultStack"/>
+ </package>
+
+ <!-- empire-tiles-default -->
+ <package name="empire-tiles-default" extends="empire-default">
+ <!-- Tiles -->
+ <result-types>
+ <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
+ </result-types>
+ </package>
+
+ <!-- empire-portlet-default -->
+ <package name="empire-portlet-default" extends="struts-portlet-default">
+
+ <!-- Result Types -->
+ <result-types>
+ <result-type name="dispatcher" class="org.apache.empire.struts2.web.EmpirePortletResult" default="true"/>
+ <result-type name="redirect" class="org.apache.empire.struts2.web.EmpirePortletResult"/>
+ </result-types>
+
+ <!-- Interceptors -->
+ <interceptors>
+ <!-- org.apache.empire.struts2 Interceptors -->
+ <interceptor name="actionBasics" class="org.apache.empire.struts2.interceptors.ActionBasicsInterceptor" >
+ <param name="errorAction">error</param>
+ </interceptor>
+ <!-- org.apache.empire.struts2 Interceptors -->
+ <interceptor name="actionAccess" class="org.apache.empire.struts2.interceptors.ActionAccessInterceptor" >
+ <param name="loginAction">login</param>
+ <!--
+ <param name="accessDeniedAction">login!doAccessDenied</param>
+ -->
+ </interceptor>
+ <!-- Basic stack -->
+ <interceptor-stack name="empirePortletStack" >
+ <!-- Portlet-Interceptors -->
+ <interceptor-ref name="portletState"/>
+ <interceptor-ref name="portletAware"/>
+ <!-- Struts-Interceptors -->
+ <!--
+ <interceptor-ref name="exception"/>
+ <interceptor-ref name="alias"/>
+ <interceptor-ref name="i18n"/>
+ -->
+ <interceptor-ref name="checkbox"/>
+ <!--
+ <interceptor-ref name="multiselect"/>
+ -->
+ <interceptor-ref name="params">
+ <param name="excludeParams">dojo\..*,^struts\..*</param>
+ </interceptor-ref>
+ <!--
+ <interceptor-ref name="servletConfig"/>
+ <interceptor-ref name="prepare"/>
+ <interceptor-ref name="chain"/>
+ <interceptor-ref name="modelDriven"/>
+ <interceptor-ref name="staticParams"/>
+ <interceptor-ref name="actionMappingParams"/>
+ <interceptor-ref name="params">
+ <param name="excludeParams">dojo\..*,^struts\..*</param>
+ </interceptor-ref>
+ <interceptor-ref name="conversionError"/>
+ <interceptor-ref name="validation">
+ <param name="excludeMethods">input,back,cancel,browse</param>
+ </interceptor-ref>
+ <interceptor-ref name="workflow">
+ <param name="excludeMethods">input,back,cancel,browse</param>
+ </interceptor-ref>
+ -->
+ </interceptor-stack>
+ </interceptors>
+ <!-- Default interceptor stack. -->
+ <default-interceptor-ref name="empirePortletStack"/>
+ </package>
+</struts>
Propchange: incubator/empire-db/trunk/empire-db-struts2/src/main/resources/struts-empire.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain