| View previous topic :: View next topic |
| Author |
Message |
solutionGood
Joined: 05 Mar 2007 Posts: 1
|
Posted: Mon Mar 05, 2007 12:21 pm Post subject: solution for myjavaserver.com question |
|
|
| Code: | public String getHandler(String[] config, String requestUri) {
String requestMapping = requestUri.substring(0, requestUri.lastIndexOf("/"));
int k = 0;
if(requestMapping.length() == 0) requestMapping = "/";
for(int i = 0; i < config.length; i+=2) {
if (config[i].equals(requestMapping) || config[i].equals("/")) {
k = i + 1;
}
}
return (k ==0 ? "N6PCAq":config[k]) ;
} |
|
|
| Back to top |
|
 |
|
|