Zimlet Developers Guide:Java and JSP: Difference between revisions
No edit summary |
|||
Line 25: | Line 25: | ||
|} | |} | ||
== Overview == | |||
Using Java and JSP with your zimlets allows you to incorporate server-side processing with your zimlet. | |||
== JSP == | |||
JavaServer Pages (JSP) allow you to create dynamic page content with Java. The JSP pages are executed on the server. JSP pages can be included with your zimlet. To reference a JSP page from your zimlet, you need to determine the page (i.e. resource) location. | |||
If you plan to call your JSP page from the [[ZCS_6.0:Zimlet_Developers_Guide:Zimlet_Definition_File_Reference|Zimlet Definition File]] (for example, from an <code><actionUrl></code> element), the path to the JSP is: | |||
<pre> | |||
/service/zimlet/{zimlet-name}/{jsp-file-name}.jsp | |||
</pre> | |||
For example, calling a JSP file named "jspfile.jsp" (located at the root of your zimlet package) from an <code><actionUrl></code> element: | |||
<pre> | |||
<actionUrl method="get" target="/service/zimlet/com_zimbra_simplejspaction/jspfile.jsp" /> | |||
</pre> | |||
Note: if using the [[ZCS_6.0:Zimlet_Developers_Guide:Dev_Environment_Setup#Zimlet_Development_Directory|Development Directory]], the path will include <code>_dev</code>. For example: | |||
<pre> | |||
<actionUrl method="get" target="/service/zimlet/_dev/com_zimbra_simplejspaction/jspfile.jsp" /> | |||
</pre> | |||
== Useful Links == | == Useful Links == |
Revision as of 04:12, 31 December 2009
Introduction | Getting Started | Dev Environment Setup | Developing Zimlets |
|
API Specifications | Example Zimlets |
Overview
Using Java and JSP with your zimlets allows you to incorporate server-side processing with your zimlet.
JSP
JavaServer Pages (JSP) allow you to create dynamic page content with Java. The JSP pages are executed on the server. JSP pages can be included with your zimlet. To reference a JSP page from your zimlet, you need to determine the page (i.e. resource) location.
If you plan to call your JSP page from the Zimlet Definition File (for example, from an <actionUrl>
element), the path to the JSP is:
/service/zimlet/{zimlet-name}/{jsp-file-name}.jsp
For example, calling a JSP file named "jspfile.jsp" (located at the root of your zimlet package) from an <actionUrl>
element:
<actionUrl method="get" target="/service/zimlet/com_zimbra_simplejspaction/jspfile.jsp" />
Note: if using the Development Directory, the path will include _dev
. For example:
<actionUrl method="get" target="/service/zimlet/_dev/com_zimbra_simplejspaction/jspfile.jsp" />
Useful Links
- Examples > Simple JSP (via Action)
- Examples > Simple JSP (via JavaScript Handler Object)
- Examples > Simple JSP (via HTTP GET)
- Examples > Simple JSP (via Ajax Asynchronous)
- JSP with custom Java classes