Question: I am new to Apache. I have 2 jboss (Jboss as 7.1.1) and apache httpd server. I am using mod\_cluster for load balancing. I wish to hide the jboss url from user and wish to show the user clean urls.

for e.g. 

www.mydomain.com will be having my static website.  

subdomain.mydomain.com should go to mydomain.com:8080/myapp  

subdomain.mydomain.com/mypage.xhtml should go to mydomain.com:8080/myapp/mypage.xhtml  

sumdomain.mydomain.com/myservice should go to mydomain.com:8080/myapp/service.xhtml?name=myservice  

I have tried many things with no success. Can some one tell me if it is possible or not. And if possible what are the things I should do.

Thanks a lot in advance.

Regards.

Answer: 
You could roll your own without too much coding using `do.call`:

```
partial <- function(f, ...) {
  l <- list(...)
  function(...) {
    do.call(f, c(l, list(...)))
  }
}

```

Basically `partial` returns a function that stores `f` as well as the originally provided arguments (stored in list `l`). When this function is called, it is passed both the arguments in `l` and any additional arguments. Here it is in action:

```
f <- function(a, b, c, d) a+b+c+d
p <- partial(f, a=2, c=3)
p(b=0, d=1)
# [1] 6

```
You have also `Curry` from package `functional`:

```
library(functional)

f <- function(a, b, c, d) a+b+c+d
ff = Curry(f, a=2, c=10)

ff(1,5)
#[1] 18

ff(b=1,d=5)
#[1] 18

```