Edit mode is only available to logged in users to edit the portlet preferences based on the user's needs.
For my application if the user clicks edit button I am redirecting to Sample1.jsp and if the user clicks Cancel button I am redirecting to Sample2.jsp. Its not mandatory that the user should be logged in to do this opertaion.
Is it possible to enable the edit mode even if the user is not logged in?
Thanks in advance.
Why use the Edit mode for that purpose? According to the JSR-168 spec PLT.8.2:
Within the EDIT portlet mode, a portlet should provide content and logic that lets a user customize the behavior of the portlet.