i am new to portlet and I have a visit.jsp page with an href tag as follows:
<a href="www.randomUrl.com">Visit ....</a>
Basically my requirement is that i just have to call a method called methodVisit
in a VisitController.java
when i click on the href and return back to visit.jsp.
Then in my methodVisit
add an attribute called isVisited to my model and return to my visit.jsp page
so my method will have the following line i guess:
VisitController.java
public .. methodVisit(...){
model.addAttribute("isVisited", isVisited));
}
Then when i return on my visit.jsp page i can use this check:
<c:if test="${isVisited}">
Then display this line when href is clicked from visit.jsp page
</c:if>
I have seen the following example when submit button is used:
<portlet:actionURL var="returnToSearchUrl" >
<portlet:param name="ActController" value="returnToSearch" />
</portlet:actionURL>
<input type="button" class="button" value='<spring:message code="button.returSearch" />' onclick="self.location='${returnToSearchUrl}'"/>
@ActionMapping(params = "ActController=returnToSearch")
public void returnToSearch(){
......
}
However no example when using the href one, any advice how to do it with href please?