Hi Andre,
I found out how to get the session value in Custom Validator class or
Custom-Dynamic SelectionList class
But still i dont no how get the session value from a java class ,such that
the java class does not have any of its references to form(Cforms).
I think it may work for ActionListener class as well.
Its a temporary solution.
<fd:field id="test">
<fd:label><i18n:text>test</i18n:text></fd:label>
<fd:datatype base="string"/>
<fd:selection-list type="java" nullable="false"
class="com.sample.TestSelectionList"/>
</fd:field>
Sample Code:
---------------
public class TestSelectionList extends AbstractJavaSelectionList implements
Contextualizable {
..
@Override
protected boolean build() throws Exception {
..
Request request = ContextHelper.getRequest(this.context);
String userId = "";
if(request.getSession().getAttribute("userId") != null) {
userId = request.getSession().getAttribute("userId").toString();
}
}
public void contextualize(Context context) throws ContextException {
this.context = context;
}
}
--
View this message in context:
http://www.nabble.com/How-to-get-the-session-attribute-in-bean-tp20089416p21825696.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]