cancel
Showing results for 
Search instead for 
Did you mean: 

Values to be passed from a string to a JSP session using session object.

Former Member
0 Kudos

Dear Developers,

i have a aspx page which is returns a variable in a session for example: Session("EmpDis")

which displays name. Now i want to extract that value from the session and display in my JSP page.

The Data Exchange is being done Using the Session Object .

Once i get this value i will pass this value to an RFC which will give me certain detials

Please do help me how do i extract that value from the session and display in my JSP page.

Thanks and Regards,

Soumyadeep.

Full points will be given, thanks in advance

Edited by: Soumyadeep Ghosh on Aug 2, 2008 2:15 PM

Accepted Solutions (0)

Answers (3)

Answers (3)

srinivas_sistu
Active Contributor
0 Kudos

Hi,

Inside your JSP,

<%

String strSessionVar=null;

if(session.getAttribute("AttributeName")!=null)

{

strSessionVar=(String)session.getAttribute("AttributeName");

}

%>

Regards,

Srinivas.

Former Member
0 Kudos

Dear Srinivas,

Thanks a lot for your help.

I have a JSP dynpage after i logon from the aspx page. Where do i need to insert the above code ???i.e. the JSP dynpage or where??? Please do specify.

srinivas_sistu
Active Contributor
0 Kudos

Hi,

Code you have to include inside your JSP Page...

Regards,

Srinivas.

former_member189631
Active Contributor
0 Kudos

Soumyadeep Ghosh

Please try one of these,

<% String strSession = session.getAttribute("sessVar");

%>

or

<% String strSession = session.getValue("sessVar");

%>

Here sessVar is name of the session variable . the value is null by default

Ram

Former Member
0 Kudos

check with

session.getAttribute("");

Former Member
0 Kudos

use

<% String strSession = (String)session.getAttribute("sessVar");

%>