Project

General

Profile

« Previous | Next » 

Revision 35505

refactoring for mavenization

View differences:

CXFStruts2ActionMapper.java
8 8
 */
9 9
package gr.uoa.di.driver.web.listeners;
10 10

  
11
import javax.servlet.http.HttpServletRequest;
12

  
11
import com.opensymphony.xwork2.config.ConfigurationManager;
12
import org.apache.struts2.RequestUtils;
13 13
import org.apache.struts2.dispatcher.mapper.ActionMapping;
14 14
import org.apache.struts2.dispatcher.mapper.DefaultActionMapper;
15 15

  
16
import com.opensymphony.xwork2.config.ConfigurationManager;
16
import javax.servlet.http.HttpServletRequest;
17 17

  
18 18
/**
19 19
 * ActionMapper that excludes all /services/* URLs. A shame that this can't be
......
21 21
 * 
22 22
 */
23 23
public class CXFStruts2ActionMapper extends DefaultActionMapper {
24
	@Override
25
	public ActionMapping getMapping(HttpServletRequest request,
26
			ConfigurationManager configManager) {
27
		ActionMapping mapping = new ActionMapping();
28
		String uri = getUri(request);
29
		int indexOfSemicolon = uri.indexOf(";");
30
		
31
		uri = (indexOfSemicolon > -1) ? uri.substring(0, indexOfSemicolon): uri;
32
		uri = dropExtension(uri, mapping);
24
        @Override
25
        public ActionMapping getMapping(HttpServletRequest request,
26
                                        ConfigurationManager configManager) {
27
            ActionMapping mapping = new ActionMapping();
28
            String uri = RequestUtils.getUri(request);
29
            int indexOfSemicolon = uri.indexOf(";");
33 30

  
34
		if (uri != null && uri.matches("/services/.*")) {
35
			return null;
36
		} else {
37
			return super.getMapping(request, configManager);
38
		}
39
	}
40
}
31
            uri = (indexOfSemicolon > -1) ? uri.substring(0, indexOfSemicolon): uri;
32
            uri = dropExtension(uri, mapping);
33

  
34
            if (uri != null && uri.matches("/services/.*")) {
35
                return null;
36
            } else {
37
                return super.getMapping(request, configManager);
38
            }
39
        }
40
    }

Also available in: Unified diff