Dashboard > blojsom 3.0 > ... > Plugins > Parameter To Context Plugin
  blojsom 3.0 Log In   View a printable version of the current page.  
  Parameter To Context Plugin
Added by Cliffano Subagio, last edited by Cliffano Subagio on Dec 23, 2007  (view change)
Labels: 

Availability

Parameter To Context Plugin v0.2 is available at Blojsom3 Plugins download page.

Description

Parameter to Context Plugin puts all request parameters to context map. Each parameter name will be prefixed with a "param_" string in the context, and can conveniently be retrieved from the Velocity templates.

Installation and Setup

Place param2ctxplugin-x.y.jar in /WEB-INF/lib/ directory.

Add the following to /WEB-INF/classes/blojsom-plugins.xml file.

<bean id="param2ctx" class="com.mbledug.blojsom.plugin.param2ctx.Param2CtxPlugin" init-method="init" destroy-method="destroy"/>

Modify HTML plugin chain from Blojsom administration menu plugins->mappings
Add "param2ctx" to one of the flavor-based plugin chains. You can place it anywhere within the chain, for example:

html ..., param2ctx, ...

Usage

Context variables prefixed with the word "param_" are made available for each query parameter.

For example: for URL http://yourhost.com/blog/default/something?first=fooone&second=bartwo , you can display the values of those parameters with:

First parameter is $param_first
Second parameter is $param_second

Site running on a free Atlassian Confluence Open Source Project License granted to blojsom. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.4 Build:#809 Jun 12, 2007) - Bug/feature request - Contact Administrators