WEB4J Development Tools 4.10.0.0

hirondelle.web4jtools.util
Class SaveToFile

Object
  extended by SimpleTagSupport
      extended by TagHelper
          extended by hirondelle.web4jtools.util.SaveToFile
All Implemented Interfaces:
JspTag, SimpleTag

public final class SaveToFile
extends TagHelper

Echo the trimmed body, while also saving it as a file on the server as a side-effect.

Uses two settings in web.xml :

Example use case in a JSP :

<w:saveToFile named='statements.sql'>
 ...JSP content...
</w:saveToFile>
 
The exact location of the generated files depends on the package name. If the above snippet is for a feature having the package com.xyz.jet, then the generated file will be

[project-root]/WEB-INF/classes/com/xyz/jet/statements.sql


Constructor Summary
SaveToFile()
           
 
Method Summary
protected  String getEmittedText(String aBody)
           
static boolean isEnabled()
          Return true only if BaseDirectoryForGeneratedFiles (web.xml) is not set to 'Disabled' (ignoring case).
static void readConfig(ServletConfig aConfig)
          Read in configuration from web.xml
 void setNamed(String aFileName)
          Set the name of the emitted file.
 
Methods inherited from class TagHelper
checkForContent, crossCheckAttributes, doTag, getPageContext, getPageName, getRequest, getResponse
 
Methods inherited from class SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaveToFile

public SaveToFile()
Method Detail

readConfig

public static void readConfig(ServletConfig aConfig)
Read in configuration from web.xml


setNamed

public void setNamed(String aFileName)
Set the name of the emitted file.


getEmittedText

protected String getEmittedText(String aBody)
                         throws JspException,
                                IOException
Specified by:
getEmittedText in class TagHelper
Throws:
JspException
IOException

isEnabled

public static boolean isEnabled()
Return true only if BaseDirectoryForGeneratedFiles (web.xml) is not set to 'Disabled' (ignoring case).


WEB4J Development Tools 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.26