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: 
There are functions in the `pryr` package that can handle this, namely `partial()` 

```
f <- function(a, b, c, d) a + b + c + d 
pryr::partial(f, a = 1, c = 2)
# function (...) 
# f(a = 1, c = 2, ...)

```

So you can use it like this - 

```
new_fun <- pryr::partial(f, a = 1, c = 2)
new_fun(b = 2, d = 5)
# [1] 10
## or if you are daring ...
new_fun(2, 5)
# [1] 10

```

You could also simply change `f()`'s formal arguments with

```
f <- function(a, b, c, d) a + b + c + d 
formals(f)[c("a", "c")] <- list(1, 2)
f
# function (a = 1, b, c = 2, d) 
# a + b + c + d
f(b = 2, d = 5)
# [1] 10

```

But with the latter, you **must** name the `b` and `d` arguments in `f()` to avoid an error when you want to leave `a` and `c` as their default values.
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

```