Results 1 to 2 of 2

Thread: invoke custom servlet in zimlets

  1. #1
    arm
    arm is offline Starter Member
    Join Date
    Feb 2014
    Posts
    2
    Rep Power
    1

    Default invoke custom servlet in zimlets

    Hi

    Is posible to invoke a custom servlets in zimlets, If yes, in which type of file (war, jar) should I package my servlets and where to put it ?,
    I would like to invoke it as action of my jsp form page.



    Thanks

  2. #2
    g41n's Avatar
    g41n is offline Intermediate Member
    Join Date
    Jun 2013
    Posts
    23
    Rep Power
    2

    Default

    Hi,
    personally I've write some code in a JSP file (i.e. manager.jsp) and put it in the root of my zimlet.
    Then, when I need to send some data from JS to JSP I use something like this:
    Code:
    params = [
        "action=search",
        "term=" + term
    ];
    var url = this.getResource("manager.jsp");
    url += "?" + params.join("&");
    var res = AjxRpc.invoke(null, url, null, null, true);
    if (!res.success) {
        alert("response: " + res.text);
    } else {
        alert("error: " + res.text);
    }
    Some additional hints:
    * For developing zimlets I usually use http://myzimbra?dev=1
    * For having no JSP cache (otherwise you have to zmmailboxdctl restart every JSP change) I've modified /opt/zimbra/jetty/etc/webdefault.xml changing development, checkInterval and reload-interval values from this:
    Code:
    <init-param>
        <param-name>development</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>checkInterval</param-name>
        <param-value>0</param-value>
    </init-param>
    <init-param>
        <param-name>reload-interval</param-name>
        <param-value>-1</param-value>
    </init-param>
    to this

    Code:
    <init-param>
        <param-name>development</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>checkInterval</param-name>
        <param-value>1</param-value>
    </init-param>
    <init-param>
        <param-name>reload-interval</param-name>
        <param-value>1</param-value>
    </init-param>
    than you have to restart jetty with zmmailboxdctl restart.
    Don't use it in production.
    If you create a Zimlet (in .zip format) with a greater version number, when you deploy it for upgrading, Zimbra updates the JSP cache automatically.

    Hope it helps
    YetOpen S.r.l. ~ Your open source partner
    Lecco (LC) - ITALY
    http://www.yetopen.it

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ZD 2.0, How to make custom Zimlets?
    By Milagro in forum General Questions
    Replies: 2
    Last Post: 10-28-2010, 06:10 AM
  2. how to invoke a servlet from zimlet
    By srinath in forum Zimlets
    Replies: 9
    Last Post: 01-12-2009, 05:28 AM
  3. Jetty Servlet - not available
    By bruciebruce in forum Installation
    Replies: 0
    Last Post: 09-29-2008, 07:46 PM
  4. unable to deploy custom zimlets
    By ras in forum Zimlets
    Replies: 1
    Last Post: 04-02-2008, 02:53 AM
  5. Calling custom servlet from ZimbraWebClient
    By sharma.k.lalit in forum Developers
    Replies: 1
    Last Post: 08-06-2007, 08:33 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •