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 protected]>
>> Date: July 13, 2011 6:47:15 AM GMT+03:00
>> To: WebObjects Development <[email protected]>
>> 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 protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/jean_francois_veillette%40yahoo.ca
>
> This email sent to [email protected]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]