04-16-2012 02:50 PM
04-16-2012 07:44 PM
Hi guys;
Been struggling with this for over 5 days now.
My quickstart site works well but I would like to change the content-type(mimeType) that it outputs to the browser.
You'll notice that most pages get outputted as html/text.
Is there a way to set the headers on a template to have it output to the browser as text/css ?
Thanks for any help.
<bean parent="webscripts.formatmap">
<property name="formats">
<props>
<prop key="css">text/css</prop>
</props>
</property>
</bean>
04-17-2012 11:15 AM
<?xml version="1.0" encoding="UTF-8"?>
<template-instance>
<title>css</title>
<description>Template to display contents of a CSS file</description>
<template-type>css</template-type>
<content>text/css</content>
</template-instance>
<@streamasset asset=asset/>
04-17-2012 06:58 PM
Hi russ;
I've added the bean with no issues.
The issue I do have is that the css is not being delivered directly though a web-script but rather a template.
The Temlates ftl just uses Streamasset directive.
(the URL hostost/context/css/style.css
The file style.css has the template css assigned to render it. The css template is below.
Is it possible to set the output type of a template?
css.xml<?xml version="1.0" encoding="UTF-8"?>
<template-instance>
<title>css</title>
<description>Template to display contents of a CSS file</description>
<template-type>css</template-type>
<content>text/css</content>
</template-instance>
css.ftl<@streamasset asset=asset/>
04-18-2012 08:15 AM
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.1//EN"
"./dtd/urlrewrite3.1.dtd">
<urlrewrite default-match-type="wildcard">
<!– Spring Surf –>
<!– Not required by quickstart
<rule>
<from>/proxy**</from>
<to>/service/proxy/$1</to>
</rule>
<rule>
<from>/res/**</from>
<to>/service/resource/$1</to>
</rule>
<rule>
<from>/service/**</from>
<to>/service/$1</to>
</rule>
–>
<rule match-type="regex">
<from>/(core-css|core-js|img|core-images|swf)/.*</from>
<set name="static">true</set>
</rule>
<rule>
<condition type="attribute" name="static" operator="notequal">true</condition>
<from>/service/**</from>
<to>/dev/$1</to>
</rule>
<rule>
<condition type="attribute" name="static" operator="notequal">true</condition>
<from>/**</from>
<to>/service/$1</to>
</rule>
<outbound-rule>
<from>/service/**</from>
<to>/$1</to>
</outbound-rule>
</urlrewrite>
04-26-2012 04:52 AM
<link href="http://host:port/appcontext/service/scriptToLoadCss?pathToFile=[]" rel="stylesheet" type="text/css" />05-22-2012 12:22 PM
var file = space.childByNamePath("site.css");
file.mimetype = "text/css";
<link href="http://host:port/appcontext/folder/site.css" rel="stylesheet" type="text/css" />
05-23-2012 01:51 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.