Re: ERXResponseRewriter.addStylesheetResourceInHead(...)
Re: ERXResponseRewriter.addStylesheetResourceInHead(...)
- Subject: Re: ERXResponseRewriter.addStylesheetResourceInHead(...)
- From: Jean-Francois Veillette <email@hidden>
- Date: Thu, 14 Jul 2011 08:43:45 -0400
By default ERXResponseRewriter will insert just before the "</head>" tag, you can call
You could use insertInResponseBeforeTag directly and use it like this:
1- keep an 'early-tag' in your html, like:
<html>
<head>
<!-- EARLY_TAG -->
...
2- use use that tag as a reference:
public void appendToResponse(WOResponse response, WOContext context) {
super.appendToResponse(response, context);
String content = "<link rel=\"stylesheet\" type=\"text/css\" href=\""+ URL + ... you get the idea ...;
tagMissingBehavior
ERXResponseRewriter.insertInResponseBeforeTag(response, context, content, "<!-- EARLY_TAG", TagMissingBehavior.Top);
}
Warning:
If you make your call manually, you do not benefit from many automatic checking done for you:
- making sure the resources is loaded only once
- resources replacement
- ajax style response support (that may not have <head> in it at all).
- probably other things ... look at what ERXResponseRewriter is doing when you simply call ERXResponseRewriter.addStylesheetResourceInHead
Le 2011-07-14 à 05:48, Farrukh Ijaz a écrit :
> Re-sent to grab attention :), may be some of you could have a solution!
>
> Thanks,
>
> Farrukh
>
> Begin forwarded message:
>
>> From: Farrukh Ijaz <email@hidden>
>> Date: July 13, 2011 6:47:15 AM GMT+03:00
>> To: WebObjects Development <email@hidden>
>> Subject: ERXResponseRewriter.addStylesheetResourceInHead(...)
>>
>> Hi Guys,
>>
>> I've an issue. In the ERXResponseRewriter is a method called addStylesheetResourceInHead(...). This method adds the stylesheet right before the </head> tag.
>>
>> According to CSS style inheritance, I should load the CSS in proper sequence. The CSS I'm adding is the base CSS but because it's being inserted just before the </head> tag, the inheriting CSS appear before this CSS in the final response and therefore whole CSS hierarchy breaks. Is there a way I could make the CSS inserted right after the <head> tag?
>>
>> Thanks in advance,
>>
>> Farrukh
>>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden