2

Hello I want to Store JAXBelement value to String variable how to do this kindly tell me please. I have Following method .

public JAXBElement<String> getSessionId()
 {
    return sessionId;
}

above method is in sessiondata class. i have create object of sessiodata class like below.

 sessiondata result=new sessiondata();

i have call getsession method of sessiondata class like below.

result.getssionId();

now i want to store sessionid in to string variable. but its type is JAXBelment now tell me how to store in to String.

now i want to store sessionId to One String variable. and pass in to another method. kindly help me.

Kapil
  • 320
  • 6
  • 10
  • 23

1 Answers1

0

String sID = (String)result.getSessionId().getValue();

agad
  • 2,192
  • 1
  • 20
  • 32
  • this Give me error like cannot find symbol symbol: method getSessionId() location: class SimplifiedJSPServlet – Kapil Aug 01 '13 at 06:23
  • That means, that your compilator can't find method getSessionId() in class SimplifiedJSPServlet not in sessiondata class. Try to localize the error in your source file. – agad Aug 01 '13 at 06:32
  • i got the ans, String Sid=result.getSessionId().toString(); – Kapil Aug 01 '13 at 06:57