asif_zzz wrote:
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).

Sorry, I cannot help you with this particular problem. I am not sure whether I actually understand your question. The session object would not have references to forms.
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;
        }
}


--
Andre H. Juffer              | Phone: +358-8-553 1161
Biocenter Oulu and           | Fax: +358-8-553-1141
Department of Biochemistry   | Email: [email protected]
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
StruBioCat                   | WWW: www.strubiocat.oulu.fi
NordProt                     | WWW: www.nordprot.org
Triacle Biocomputing         | WWW: www.triacle-bc.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to