Saturday, 31 August 2013

how to create action url for hyperlink in liferay?

how to create action url for hyperlink in liferay?

i have a requirement that when i click on hyperlink i will send one
parameter course id it has to go to action method in portlet class.then i
need to display the success and as well as failure message on after
operation done on to browser!
public void DeleteCourses(ActionRequest request,ActionResponse response)
throws IOException,PortletException
{
String cid=request.getParameter("courseId");
long courseId = Long.parseLong(cid);
try {
CourseLocalServiceUtil.deleteCourse(courseId);
}
catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
can any one tell me how to create action url for hyperlink?

No comments:

Post a Comment