| Welcome to the Zimbra :: Forums! | |
Welcome, if you would like to post a comment please register.
We also encourage you to explore all things Zimbra with our team and members of the community.
|  | 
09-14-2009, 02:30 PM
| | | [SOLVED] Zimbra send back the who .jsp file??? Hi ,
I wrote a zimlet JSP. Basically it generates a html file and send back.
After the request is sent from zimlet via AjxRpc, the whole JSP file as text is sent back (I can see the whole JSP file via the callback function which shows the "result.text").
seems the .jsp file is not recognized and compiled by the zimbra.
Did I miss any configuration or anything?
Thanks
Jason
FYI. here is the code
com_zimbra_scs.prototype._testjsp =
function()
{
var url = this.getResource("queryPres.jsp");
var params= ["who=" + AjxStringUtil.urlComponentEncode("unknownyet"),
"tags=" + AjxStringUtil.urlEncode ("noidea")
].join ("&");
var callback = new AjxCallback (this,this.onDoneGetPres);
AjxRpc.invoke(params,url+"?"+params,null,callback, true);
};
com_zimbra_scs.prototype.onDoneGetPres =
function(result)
{
alert("result is " + result.text);
}
//queryPres.jsp
<html>
<body>
JSP -> <% out.println("hello world!"); %>
</body>
</html>
Last edited by jason719; 09-14-2009 at 02:42 PM..
| 
09-15-2009, 01:55 PM
| | Zimbra Employee | |
Posts: 187
| | Quote:
Originally Posted by jason719 Hi ,
I wrote a zimlet JSP. Basically it generates a html file and send back.
After the request is sent from zimlet via AjxRpc, the whole JSP file as text is sent back (I can see the whole JSP file via the callback function which shows the "result.text").
seems the .jsp file is not recognized and compiled by the zimbra.
Did I miss any configuration or anything?
Thanks
Jason
FYI. here is the code
com_zimbra_scs.prototype._testjsp =
function()
{
var url = this.getResource("queryPres.jsp");
var params= ["who=" + AjxStringUtil.urlComponentEncode("unknownyet"),
"tags=" + AjxStringUtil.urlEncode ("noidea")
].join ("&");
var callback = new AjxCallback (this,this.onDoneGetPres);
AjxRpc.invoke(params,url+"?"+params,null,callback, true);
};
com_zimbra_scs.prototype.onDoneGetPres =
function(result)
{
alert("result is " + result.text);
}
//queryPres.jsp
<html>
<body>
JSP -> <% out.println("hello world!"); %>
</body>
</html> | Couple of things:
1. When you are doing GET, the first params should be null, since youare nor passing anything in the body.
AjxRpc.invoke(params,url+"?"+params,null,callback, true);
2. Make sure to NOT include queryPres.jsp in the cofig_template.xml file
3. Are you using _dev mode? or have you deployed it using zmzimletctl? | 
09-15-2009, 02:00 PM
| | | Quote:
Originally Posted by rrao Couple of things:
1. When you are doing GET, the first params should be null, since youare nor passing anything in the body.
AjxRpc.invoke(params,url+"?"+params,null,callback, true);
I'll try that
2. Make sure to NOT include queryPres.jsp in the cofig_template.xml file
It is not included.
3. Are you using _dev mode? or have you deployed it using zmzimletctl? | Not _dev mode, I deployed it using zmzimletctl | 
09-15-2009, 02:01 PM
| | | I even tred from the browser to type the JSP's url, it 's the same behavior. | 
09-15-2009, 02:18 PM
| | Zimbra Employee | |
Posts: 187
| | Quote:
Originally Posted by jason719 I even tred from the browser to type the JSP's url, it 's the same behavior. | I just realized you are using RC1, it has a little odd way of talking to JSPs. Its been fixed in GA. Please use 6.0 GA and if you still get into trouble, please let us know. | 
09-22-2009, 08:02 AM
| | | Weird though usually the forum send me the notification if anyone replies. Somehow it didn’t this time.
Anyway, I got the GA version for RHRL installed on my system (I only have CentOS).
Installation seems fine until when I tried to start it. (a couple of services failed to start)
[zimbra@zimbra bin]$ ./zmcontrol status
Host zimbra.lab.local
antispam Running
antivirus Running
convertd Running
imapproxy Stopped
zmnginxctl is not running
ldap Running
logger Running
mailbox Stopped
zmmtaconfig is running.
mailboxd is not running.
zmmailboxdctl is not running
memcached Running
mta Stopped
postfix is not running
snmp Running
spell Stopped
zmapachectl is not running
stats Running
[zimbra@zimbra bin]$ | 
09-22-2009, 10:59 AM
| | | Hi,
Now I trie to install open source GA on Fedora 11 which is official supported. ldap rpm failed to be installed.
Then installation got canceled. :-( | | Thread Tools | Search this Thread | | | | | Display Modes | Linear Mode | | Why Join? Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.  |