Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Zimlets

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.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-16-2009, 03:34 AM
Beginner Member
 
Posts: 2
Exclamation Error 405 HTTP method POST is not supported by this URL

Hello,
i have a problem devloping a jsp based zimlet under Zimbra 6.

this is the code associated to the onMsgView event:

Code:
        var requestParams = 
	{
		op		: 2,
		msgID	: _msgID,
		accountID : _accountID
	}; 
	thisObj = this;

	this._request("myzimlet.jsp", requestParams, function(responce)
        {
          ...
        });
and the function _request is like this:

Code:
com_zimbra_myzimlet.prototype._request = function(url, params, callback)
{	
    var requestUrl = this.getResource(url);
    
var requestHeader =
    {
        "Content-Type":"application/x-www-form-urlencoded"
    };
   
    var requestParams = this._urlEncode(params);

    var tempCallback = function(response)
    {
        var jsonResponse = eval("(" + response.text + ")");

        if(!jsonResponse.error)
        {
            callback(jsonResponse);
        }
        else
        {
            this._alert("Error", jsonResponse.error);
        }
    }

    AjxRpc.invoke(requestParams, requestUrl, requestHeader, new AjxCallback(this, tempCallback));

}
i see in firebug the error in the thread title:

HTML Code:
<title>Error 405 HTTP method POST is not supported by this URL</title> </head> <body><h2>HTTP ERROR 405</h2> <p>Problem accessing /service/zimlet/com_zimbra_myzimlet/myzimlet.jsp. Reason:
<pre>    HTTP method POST is not supported by this URL</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/> 
Is this a Zimbra 6 bug?
Note that the same zimlet works perfect in zimbra desktop (based on Zimbra 5).

Is there some extra configuration involved?

Is the AjxRpc.invoke method obsolete in Zimbra 6?

Thanks for help.
Reply With Quote
  #2 (permalink)  
Old 10-16-2009, 07:46 AM
Zimlet Guru & Moderator
 
Posts: 431
Default

There have been reports of problems here. There are three canidates:

1) The JSP is not compiling correctly:
Zimlet JSP - Zimbra :: Wiki

2) A bug in AjxRPC.invoke

3) A error in the proxy.

Can you look at the first and figure out if it applies to you?
Reply With Quote
  #3 (permalink)  
Old 10-20-2009, 09:53 AM
Beginner Member
 
Posts: 2
Default

Thanks Joshua for your reply!

I bypassed the POST problem using the useGet flag of AjxRpc.invoke function using the serverUrl followed by the params passed to the jsp.
This is the signature:

Code:
AjxRpc.invoke = function(requestStr, serverUrl, requestHeaders, callback, useGet, timeout)
Now the zimlet is working properly.

By the way.. the POST problem is not "solved" yet..
Reply With Quote
  #4 (permalink)  
Old 10-20-2009, 10:24 AM
Zimbra Employee
 
Posts: 115
Default

Quote:
Originally Posted by alioscia View Post
Thanks Joshua for your reply!

I bypassed the POST problem using the useGet flag of AjxRpc.invoke function using the serverUrl followed by the params passed to the jsp.
This is the signature:

Code:
AjxRpc.invoke = function(requestStr, serverUrl, requestHeaders, callback, useGet, timeout)
Now the zimlet is working properly.

By the way.. the POST problem is not "solved" yet..
alioscia,
Its most likely a bug w.r.t POST to custom-jsp throwing 405, I think web.xml isn't configured properly to allow this.

With that exception, AjxRpc.invoke should work just fine like in 5.0.x (i.e. http get and http post to external sites; http get to internal jsp)
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0