0

I have created a liferay portlet using mvc (jsp ) and i'm using JQuery for datatable. I have succeeded to bring a list and display it on a table using Jquery. Now, I'm trying to make it editable to use CRUD functions.

The problem that i'm using java not php and i couldn't assign a servlet function (doget).i didn't understand it well (how to use it) and they set the url of this class to jquery.

If i'm not wrong this would be configured in web.xml (servlet mapping). So i wonder how to properly configured and use it? Also, i don't know jquery but it seems that the buttons needs to be manually included. is there any method to include them directly? (with jquery looks and pop up). Servlet comes in 2.4 version i had troubles changing it to 3.0 using eclipse.

Best Regards

Mohamed
  • 3
  • 1

1 Answers1

0

If you use web.xml and servlets, you are out of liferay and the implementation for user login, themeDisplay, permissions and other features. This way is dificult and improductive.

Better choice is override the method "serveResource" of your portlet, in this method you have all control like in servlets and you can use other features of liferay.

In this question you have an example and more information: respond to http request with json object in portlet

Community
  • 1
  • 1
drenedo
  • 69
  • 5
  • Thanks can you explain further how i can do otherwise? do i need to replace ajaxResourceURL by the servlet url? – Mohamed Apr 14 '15 at 19:16
  • The example is wrong, the tag "portlet:resourceURL" declares a variable String who has the url value for the method serveResource. Change at the example this line: var url = '<%=ajaxResourceURL %>'. Sorry, you must read the comments – drenedo Apr 15 '15 at 11:16