Name | Embedded JSP Plugin |
---|---|
Publisher | Apache Software Foundation |
License | Open Source (ASL2) |
Version | not released (Struts sandbox) |
Homepage | this is it |
...
...
The Embedded JSP plugin
Excerpt |
---|
allows you to use JSPs from the classpath (from jar files) |
Introduction
JSPs are usually served from the file system. Using this plugin you can deploy JSPs inside jar files, which is sometimes desired, like when writing a plugin.
Wait...what?
The plugin containes a modified version of Jasper 5, which reads JSPs from the classpath, and generates the java code in memory (no .java file is written). The Java Compiler API is then used to compile the java source code into a bytecode (in memory, no .class file is generated), and it is turned into a Servelet, which is cached for future use
About includes
Because the JSP
files |
) |
org/myexample/jsps
in a jar file:Who.jsp:
Code Block |
---|
Hello there, I am the Doctor.
|
Hello.jsp:
Code Block |
---|
<jsp:include page="org.myexample/jsps/Who.jsp" />
|
Mapping:
...
<package name="example" namespace="/example" extends="jsp-default">
<action name="HelloWorld" class="example.HelloWorld">
<result type="embeddedJsp">org/myexample/jsps/Hello.jsp</result>
</action>
</package>
Requirements
...
...
Installing
...
.
...
If you are using maven add this to your pom.xml:
...