-
Notifications
You must be signed in to change notification settings - Fork 3
FAQ
gtosto edited this page Apr 9, 2016
·
2 revisions
Frequently Asked Questions
Just implement the SessionAware interface in your action then retrieve the BreadCrumbTrail from the session and rewind the trail to the position -1.
For example:
import org.apache.struts2.interceptor.SessionAware;
import xyz.timedrain.arianna.plugin.BreadCrumbInterceptor;
import xyz.timedrain.arianna.plugin.BreadCrumbTrail;
public class RewindAction implements SessionAware {
private Map<String, Object> session;
public void setSession(Map session) {
this.session = session;
}
public String execute() {
// retrieve the bread crumb trail from session
BreadCrumbTrail trail = (BreadCrumbTrail) session.get(BreadCrumbInterceptor.CRUMB_KEY);
// rewinding at position -1 has the effect of clearing the entire trail
trail.rewindAt(-1);
return "success";
}
}Yes, get the BreadCrumTrail from the session and call the setMaxCrumbs method.