0

I am using JSR 286 portlets and using serveResource() method to achieve AJAX call. Implementation works fine in my localhost server. But it does not work once deployed on application server. Below given is the architecture. Architecture

Below given is the code from client :

$.ajax({
            url : '<portlet:resourceURL/>',
            dataType: "xml",
            data : {ssousername: user, passwordsrv : pass, ipRandomValue : ip, deviceTypeHidden : browserStringVar}, 
            cache : false,
            type : 'POST',
            withCredentials:true,
            crossDomain:true,
            success : function(xml) {
                   // Success Logic
                },
            error : function (jqXHR, textStatus, errorThrown) {
                console.log('Error Occurred' + errorThrown);
                // Failure logic
            }
        });

On application server it gives an 403 error of forbidden. I think there has to be some configuration that needs to be done at OHS (apache 2). I tried with below configuration in OHS but it did not work.

Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
Taksh
  • 431
  • 4
  • 8
  • You need to check permission of folder .This problem maximum create due to incorrect folder permission – sachin Jan 25 '16 at 08:59
  • Hi Sachin, all folders have necessary permissions specified. Application works fine without AJAX call. I think ajax is asking for CORS, which i suppose have implemented too. But it seems still I am missing something. – Taksh Jan 25 '16 at 09:24
  • 1
    Got below link : Bug 45187 - Long File name requests gives FORBIDDEN response . https://bz.apache.org/bugzilla/show_bug.cgi?id=45187 – Taksh Jan 25 '16 at 13:34

0 Answers0