Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Can be configured to suit many different requirements
  •  Utilizes native framework functionality

The plug-in extends struts-default so you can extend the "breadcrumb" package to get these additional features.

...

Code Block
======================
A sample configuration
======================

<struts>

 <package name="strutsSchool" extends="tiles-default,com.strutsschool.interceptors.breadcrumbs">

	<interceptors>
		<interceptor-stack name="strutsschoolStack">
			<interceptor-ref name="defaultStack"></interceptor-ref>
			<interceptor-ref name="breadCrumbs">
				<param name="wildCardSeparator">_</param>
	    		        <param name="uniqueCrumbsOnly">true</param>
	    		        <param name="getRequestsOnly">true</param>
	    		        <param name="crumbMax">2</param>
				<param name="excludeMethods">save,update,remove</param>
			</interceptor-ref>
		</interceptor-stack>
	</interceptors>

	<default-interceptor-ref name="strutsschoolStack"></default-interceptor-ref>
</package>
	...
</struts>

The collection of captured requests are stored in session as Crumb objects which expose the following properties:

    String action
    String nameSpace
    String wildPortionOfName
    boolean uniqueCrumbsOnly
    boolean getRequestsOnly
 

Code Block

====================	
A sample page region
====================
<div class="breadcrumbs" style="float: left; width: 100%;">
<span> 
	<s:iterator	value="%{#session['com.strutsschool.interceptors.breadcrumbs']}" status="status">
		<s:if test="#status.index > 0"> 
			&#187;
		</s:if>
		<s:url id="uri" action="%{action}" namespace="%{nameSpace}"/>
		<nobr><s:a href="%{uri}"><s:property value="wildPortionOfName"/></s:a></nobr>
	</s:iterator> 
</span>
</div>

You could also include screenshots by attaching the images to this page:

...

Setting

Description

Default

Possible Values

crumbMax

Maximum crumbs to manage before a new request begiwill will pop the oldest from stack
.  It's a running list of crumbs.

4 2

int

uniqueCrumbsOnly

Determines if the same Crumb object is unique in CrumbCollection crumb collection

true

boolean{}

getRequestsOnly

This will include only HTTP method=GET requests

true

boolean{}

wildCardSeparator

Wildcard separator used in action mappings.  e.g.

Code Block

http://
strutsschool
somesite.com/
samples
somepackage/
MemberAction
SomeAction_print.action?
Image Removed

.. uses the (_)

{ _ }

String{}

includeMethods

Maximum crumbs to manage before a new request begiwill pop the oldest from stack

2

Plug-in utilizes MethodFilterInterceptor, so you can configure methods to be included

none

comma delimited list int

excludeMethods

Maximum crumbs to manage before a new request begiwill pop the oldest from stack

2

show,edit,destroy,save,update,remove

comma delimited list int

This plugin can be installed by copying the plugin jar into your application's /WEB-INF/lib directory. No other files need to be copied or created.

...