Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Hi everyone, I'm facing an issue when accessing a servlet (POST) via ajax from dispatcher.
Everything works well in my local and author mode.I've removed POST method in "com.adobe.granite.csrf.impl.CSRFFilter.cfg" as well as allowed the path in filters.any.
Here's my config:
Remove for privacy
Do you guys have any idea for this issue? Please correct me if i'm wrong in any step.
Thanks.
¡Resuelto! Ir a solución.
Vistas
Respuestas
Total de me gusta
Hi everyone, My issue has been resolved, The code is correct at all. I just forgot to uncheck ignore web tier configuration on a pipeline configuration. So the dispatcher wasn't deployed
Vistas
Respuestas
Total de me gusta
As you have already confirmed it works fine in local publisher (it means you have enabled post method in servlet class and felix config also). I believe your servlet path is /bin/pdf/view and in filters.any it is allowing only GET method in your screenshot. Just allow post method for the same path.
Vistas
Respuestas
Total de me gusta
Thanks, @shashi_c .You probably misunderstood something. I registered the sling servlet that I mentioned above as resourceType with selector = 'dataForm' and extension = 'json'. the path bin/pdf/view is another servlet.
Vistas
Respuestas
Total de me gusta
Test the following:
1. Test your servlet on publisher directly, you can use postman for it.
If the servlet is working fine on the publisher, then
2. Check dispatcher logs for any error for your servlet path
3. Also, you can try updating your rule 0107 by adding /method "POST"
Vistas
Respuestas
Total de me gusta
Hi @Mohit_KBansal .
I tested the servlet on postman and it returned the same issue as dispatcher. (404 not found)
Vistas
Respuestas
Total de me gusta
Now it makes sense. Please check this discussion [1], I hope you will find some direction.
Vistas
Respuestas
Total de me gusta
I can access the servlet on publisher instance locally (4503) but not in server.
Vistas
Respuestas
Total de me gusta
I just set a dispatcher up on local and i worked well. Not sure how it didn't work on server
Vistas
Respuestas
Total de me gusta
Hi @luongpham1994
In Filter.any file have you allowed the Post servlet that you have registered through resourceType. Can't see it in attached screen print.
Vistas
Respuestas
Total de me gusta
Yes, I did.
I tested it on the local dispatcher, When committed to the allowed path, The path is not found, and it worked again when uncommented. So I think the filters is working correctly
Vistas
Respuestas
Total de me gusta
Hi everyone, My issue has been resolved, The code is correct at all. I just forgot to uncheck ignore web tier configuration on a pipeline configuration. So the dispatcher wasn't deployed
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas