|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.bbqjs.spring.debug.ImageServingServlet
@Controller public class ImageServingServlet
Serves images out of one or more directories on the classpath. The intention is you set sourceRoots to include the src/main/css directory as well as src/main/webapps/images in order to serve resources while in development which would normally be copied into the target folder by the bbq-resources-maven-plugin. Not meant to be used in production. Example Spring configuration:
<bean id="imageController" class="org.bbqjs.spring.debug.ImageServingServlet">
<property name="path" value="/images" />
<property name="sourceRoots">
<list>
<value>src/main/css</value>
<value>src/main/webapp/images</value>
</list>
</property>
</bean>
Constructor Summary | |
---|---|
ImageServingServlet()
|
Method Summary | |
---|---|
void |
serveImage(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
The controller method. |
void |
setPath(String path)
If this controller listens on http://www.example.org/images, this should be set to "/images" |
void |
setServletContext(javax.servlet.ServletContext servletContext)
|
void |
setSourceRoots(String[] sourceRoots)
Where to load images from. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageServingServlet()
Method Detail |
---|
@RequestMapping(method={POST,GET}) public void serveImage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
request
- response
-
Exception
public void setServletContext(javax.servlet.ServletContext servletContext)
setServletContext
in interface org.springframework.web.context.ServletContextAware
public void setPath(String path)
path
- public void setSourceRoots(String[] sourceRoots)
src/main/css
and src/main/webapp/images
sourceRoots
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |