|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bbqjs.spring.debug.CSSCompilerServlet
@Controller public class CSSCompilerServlet
Dynamically creates the CSS file with every request - meant for development and not recommended for production. Spring configuration example:
<bean id="cssController" class="org.bbqjs.spring.debug.CSSCompilerServlet">
<property name="pagePackage" value="${js.page.package}"/>
<property name="path" value="/css"/>
<property name="extension" value="less"/>
<property name="includes">
<list>
<value>boilerplate.less</value>
<value>common.less</value>
</list>
</property>
<property name="sourceRoots">
<list>
<value>src/main/css</value>
</list>
</property>
</bean>
The above example will respond to requests such as /css/generated/Home.less
.
Constructor Summary | |
---|---|
CSSCompilerServlet()
|
Method Summary | |
---|---|
void |
compileFile(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
The controller method. |
void |
setExtension(String extension)
This is the requested file extension - defaults to css. |
void |
setIncludes(String[] includes)
Specify any arbitrary files you want included at the top of the stylesheet. |
void |
setPagePackage(String pagePackage)
The ${js.page.package} from your pom. |
void |
setPath(String path)
This is the mount path of the controller. |
void |
setSourceRoots(String[] sourceRoots)
Where to look for CSS files - a suggested value is "src/main/css". |
void |
setTheme(String theme)
If a theme is used, pass in the name of the theme here. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CSSCompilerServlet()
Method Detail |
---|
@RequestMapping(method={POST,GET}) public void compileFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
request
- response
-
Exception
public void setTheme(String theme)
theme
- public void setPath(String path)
path
- public void setIncludes(String[] includes)
includes
- public void setExtension(String extension)
extension
- public void setPagePackage(String pagePackage)
pagePackage
- public void setSourceRoots(String[] sourceRoots)
sourceRoots
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |