Skip to content

Commit e47d606

Browse files
authored
- Force Add of Querystring parameters for Websphere (#803)
* - Force Add of Querystring parameters in Java/Tomcat7 with IBM WebSphere ( were being lost in the redirect from the filter) * - Fix API object filter to only add Querystring when Queryparameters are not empty
1 parent c3b1da1 commit e47d606

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

java/src/main/java/com/genexus/filters/APIObjectFilter.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ public class APIObjectFilter extends Filter {
2121
private ArrayList<String> appPath = new ArrayList<String>();
2222
static final String PRIVATE_DIR="private";
2323
static final String WEB_INFO="WEB-INF";
24+
static final String REST_SUBPART = "/rest/";
25+
static final String QS_SEP = "?";
26+
2427
public static final Logger logger = LogManager.getLogger(APIObjectFilter.class);
2528

2629
public void doFilter(IServletRequest request, IServletResponse response, IFilterChain chain) throws Exception {
@@ -36,7 +39,11 @@ public void doFilter(IServletRequest request, IServletResponse response, IFilte
3639
}
3740
}
3841
if(isPath) {
39-
String fwdURI = "/rest/" + path;
42+
String fwdURI = REST_SUBPART + path;
43+
String qString = httpRequest.getQueryString();
44+
if ( qString != null && !qString.isEmpty()) {
45+
fwdURI = fwdURI + QS_SEP + qString;
46+
}
4047
logger.info("Forwarding from " + path +" to: " + fwdURI) ;
4148
httpRequest.getRequestDispatcher(fwdURI).forward(request,response);
4249
}

0 commit comments

Comments
 (0)