You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2009/08/29 17:03:31 UTC

t5: URLRewriteRule, domain and CSS

hi,

my t5 app has url:

http://localhost:8080/masterlist

now I'd like to make a short cut for the user:

http://masterList:8080

above URL should go to http://localhost:8080/masterList

following code works, but it will not use the css in the app, seems css is
applicable to http://localhost, not http://masterList

any idea how to fix this? 

Thanks,

A.C.

public class DomainURL implements URLRewriterRule {

    public Request process(Request request, URLRewriteContext
urlRewriteContext) {
        String domain = request.getServerName();
        if ("masterlist".equalsIgnoreCase(domain)) {
            String newU = "/masterList/";
            request = new SimpleRequestWrapper(request, newU);            
        }
        return request;
    }

    public RewriteRuleApplicability applicability() {
        return RewriteRuleApplicability.INBOUND;
    }
}

-- 
View this message in context: http://www.nabble.com/t5%3A-URLRewriteRule%2C-domain-and-CSS-tp25203654p25203654.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: URLRewriteRule, domain and CSS

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,

got the problem fixed, it was due to not checking the path which cause all
the reference to assets to be rewritten as well.



akochnev wrote:
> 
> Angelo,
>    unless you somehow have the ability to affect DNS resolution on the
> client (or if you own masterlist.com or whatever domain you want), what
> you're looking to do just can't happen.
> 
> Cheers,
> 
> Alex K
> 
> On Sat, Aug 29, 2009 at 11:03 AM, Angelo Chen
> <an...@yahoo.com.hk>wrote:
> 
>>
>> hi,
>>
>> my t5 app has url:
>>
>> http://localhost:8080/masterlist
>>
>> now I'd like to make a short cut for the user:
>>
>> http://masterList:8080
>>
>> above URL should go to http://localhost:8080/masterList
>>
>> following code works, but it will not use the css in the app, seems css
>> is
>> applicable to http://localhost, not http://masterList
>>
>> any idea how to fix this?
>>
>> Thanks,
>>
>> A.C.
>>
>> public class DomainURL implements URLRewriterRule {
>>
>>    public Request process(Request request, URLRewriteContext
>> urlRewriteContext) {
>>        String domain = request.getServerName();
>>        if ("masterlist".equalsIgnoreCase(domain)) {
>>            String newU = "/masterList/";
>>            request = new SimpleRequestWrapper(request, newU);
>>        }
>>        return request;
>>    }
>>
>>    public RewriteRuleApplicability applicability() {
>>        return RewriteRuleApplicability.INBOUND;
>>    }
>> }
>>
>> --
>> View this message in context:
>> http://www.nabble.com/t5%3A-URLRewriteRule%2C-domain-and-CSS-tp25203654p25203654.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/t5%3A-URLRewriteRule%2C-domain-and-CSS-tp25203654p25208824.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: t5: URLRewriteRule, domain and CSS

Posted by Alex Kotchnev <ak...@gmail.com>.
Angelo,
   unless you somehow have the ability to affect DNS resolution on the
client (or if you own masterlist.com or whatever domain you want), what
you're looking to do just can't happen.

Cheers,

Alex K

On Sat, Aug 29, 2009 at 11:03 AM, Angelo Chen <an...@yahoo.com.hk>wrote:

>
> hi,
>
> my t5 app has url:
>
> http://localhost:8080/masterlist
>
> now I'd like to make a short cut for the user:
>
> http://masterList:8080
>
> above URL should go to http://localhost:8080/masterList
>
> following code works, but it will not use the css in the app, seems css is
> applicable to http://localhost, not http://masterList
>
> any idea how to fix this?
>
> Thanks,
>
> A.C.
>
> public class DomainURL implements URLRewriterRule {
>
>    public Request process(Request request, URLRewriteContext
> urlRewriteContext) {
>        String domain = request.getServerName();
>        if ("masterlist".equalsIgnoreCase(domain)) {
>            String newU = "/masterList/";
>            request = new SimpleRequestWrapper(request, newU);
>        }
>        return request;
>    }
>
>    public RewriteRuleApplicability applicability() {
>        return RewriteRuleApplicability.INBOUND;
>    }
> }
>
> --
> View this message in context:
> http://www.nabble.com/t5%3A-URLRewriteRule%2C-domain-and-CSS-tp25203654p25203654.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>