|
JSPTemplates | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.tp23.jasper.MyJasper
This is the object that serves the jsp responses, it is basically local java
tomcat. (but really simple) Remember, when running this class you need to
specify a path to put classes into; in order to run the generated classes the
directory must be in the class path.
The package created for the jsps is the
default package, this probably needs changing. In this implementatioin the
Server itself maintains a single session object this will be passed to all
jsps. If multi client mode is required it is possible to manage the Destination
object out side of the MyJasper runtime and give them whatever session you like,
as long as it is a org.tp23.jsp.Session. You can thus keep pools of sessions if you like
N.B. I have done some budget hacks that assume all jsps end in .jsp I'm not sure if this
is a requirement of Tomcat but is is a requirement of MyJapser.
Also the file names of jsps should not include and non-letter or digit characters
because I have not mangled the class calls properly. ;)
The setJspClassLoader allows MyJasper to be used in an environment where more than
one class loader is in operation, for example loading MyJapser classes from apache Jasper
Constructor Summary | |
MyJasper()
Constructor for a default MyJasper that loads its parameters from a file called myjasper.properties that is in the same directory root as this classes class file or in the same jar file. |
|
MyJasper(java.io.File jspDirectory,
java.io.File classDirectory)
Constructor for the MyJasper object |
|
MyJasper(java.io.File jspDirectory,
java.io.File classDirectory,
boolean createSession)
Constructor for the MyJasper object |
|
MyJasper(java.util.Properties configuration,
boolean createSession)
Constructor for the MyJasper object |
Method Summary | |
void |
configure()
performs all the operations of the no args constructor. |
void |
configure(java.util.Properties configuration,
boolean createSession)
performs all the operations of the MyJasper(Properties configuration, boolean createSession) constructor. |
java.util.Properties |
getConfiguration()
Gets the config or creates a default if there is none. |
Destination |
getNewDestination(java.util.Map parameters)
|
ObjectJspFactory |
getObjectJspFactory()
Gets the objectJspFactory attribute of the MyJasper object |
java.lang.String |
getOutput(java.lang.String jspFile)
|
java.lang.String |
getOutput(java.lang.String jspFile,
Destination dest)
Gets the output of a given JSP. |
java.lang.String |
getOutput(java.lang.String jspFile,
java.util.Map props)
Gets the output of a given JSP |
Session |
getSession()
Gets the session of the MyJasper object |
static void |
main(java.lang.String[] args)
Run the test method. |
void |
setClassDirectory(java.io.File classDir)
|
void |
setClassDirectory(java.lang.String classDir)
|
void |
setClasspath(java.lang.String classpath)
Sets the classpath attribute of the MyJasper object |
void |
setJspClassLoader(java.lang.ClassLoader jspClassLoader)
|
void |
setJspDirectory(java.io.File jspDir)
|
void |
setJspDirectory(java.lang.String jspDir)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MyJasper(java.io.File jspDirectory, java.io.File classDirectory)
jspDirectory
- The location of JSP filesclassDirectory
- The location of the classespublic MyJasper(java.io.File jspDirectory, java.io.File classDirectory, boolean createSession)
jspDirectory
- The location of JSP filesclassDirectory
- The location of the classescreateSession
- if true create a sessionpublic MyJasper(java.util.Properties configuration, boolean createSession)
configuration
- a populated Properties object. containing all the neccessary
item for boot up e.g. myjasper.jsp.dircreateSession
- if true create a sessionObjectContainerContextImpl
public MyJasper() throws java.io.FileNotFoundException
Method Detail |
public void configure(java.util.Properties configuration, boolean createSession)
configure
in interface Engine
public void configure() throws java.io.FileNotFoundException
public void setJspDirectory(java.lang.String jspDir)
setJspDirectory
in interface Engine
public void setJspDirectory(java.io.File jspDir)
setJspDirectory
in interface Engine
public void setClassDirectory(java.lang.String classDir)
setClassDirectory
in interface Engine
public void setClassDirectory(java.io.File classDir)
setClassDirectory
in interface Engine
public java.util.Properties getConfiguration()
getConfiguration
in interface Engine
public void setClasspath(java.lang.String classpath)
setClasspath
in interface Engine
classpath
- The new classpath valuepublic ObjectJspFactory getObjectJspFactory()
getObjectJspFactory
in interface Engine
public void setJspClassLoader(java.lang.ClassLoader jspClassLoader)
public java.lang.String getOutput(java.lang.String jspFile, java.util.Map props) throws JspEngineException
getOutput
in interface Engine
jspFile
- the name of the file (relative to the current JSP rootprops
- A set of porperties (consider this the request)JspEngineException
- public java.lang.String getOutput(java.lang.String jspFile) throws JspEngineException
getOutput
in interface Engine
public java.lang.String getOutput(java.lang.String jspFile, Destination dest) throws JspEngineException
getOutput
in interface Engine
jspFile
- the name of the file (relative to the current JSP root) e.g. mystuff.jspdest
- a destination object, by maintaining a reference to this
object it is possible to recall the result of the JSP without
having to re-run the objects service methodJspEngineException
- public Session getSession()
getSession
in interface Engine
public Destination getNewDestination(java.util.Map parameters)
getNewDestination
in interface Engine
public static void main(java.lang.String[] args)
args
- The command line arguments
|
JSPTemplates | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |