/WEB-INF/tld/liferay-portlet.tld
In the class you should have the below code
/**
*
*/
package com.aonehewit.servlet;
import com.liferay.portal.kernel.servlet.PortalDelegatorServlet;
import com.liferay.portal.kernel.util.JavaConstants;
import com.liferay.portal.kernel.util.WebKeys;
import java.io.IOException;
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author basanagowda.patil
*
*/
public class TestServlet extends HttpServlet {
@Override
public void init() throws ServletException {
// TODO Auto-generated method stub
super.init();
System.out.println("Inside the init() method****************8 of TestServlet");
}
@Override
protected void service(HttpServletRequest arg0, HttpServletResponse arg1)
throws ServletException, IOException {
System.out.println("Inside the service******************TestServlet");
super.service(arg0, arg1);
}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
System.out.println("Inside the doGet method**********************888");
super.doGet(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
// TODO Auto-generated method stub
super.doPost(req, resp);
System.out.println("Inside the Do post me thod:::::::::::::::::::");
}
}
The url to access the servlet will be as below
http://localhost:8080/delegate/testServlet
Note : delegate is not a portlet it is another servlet which is used to invoke our servlet.
I appreciate that you produced this wonderful article to help us get more knowledge about this topic.
ReplyDeleteI know, it is not an easy task to write such a big article in one day, I've tried that and I've failed. But, here you are, trying the big task and finishing it off and getting good comments and ratings. That is one hell of a job done!
Selenium training in bangalore
Selenium training in Chennai
Selenium training in Bangalore
Selenium training in Pune
Selenium Online training
Simple and nice article.Keep sharing. Java training in Chennai | Certification | Online Course Training | Java training in Bangalore | Certification | Online Course Training | Java training in Hyderabad | Certification | Online Course Training | Java training in Coimbatore | Certification | Online Course Training | Java training in Online | Certification | Online Course Training
ReplyDelete