cancel
Showing results for 
Search instead for 
Did you mean: 

portal session-id?

former_member1193316
Participant
0 Kudos
161

how to find out the portal sessin-id

Regards

venkat

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Refer the following threads

Regards,

P.Manivannan

Answers (2)

Answers (2)

Former Member
0 Kudos

hi ,,

<!-- enterName.jsp: example of session variable using Scriplets & HTML mixed -->

<%@page contentType="text/html"%>

<html>

<head><title>Session Example: enterName.jsp</title></head>

<body>

<!--

1) Get the session id and display it to the user

2) Enter a value in the text field and we will save it as a session variable

-->

<%-- THIS IS ONE WAY TO WRITE THE CODE, MIXING SCRIPLETS WITH HTML --%>

This is the session id <STRONG><%= session.getId()%></STRONG>

<BR>

<!-- check to see if the session in new, if not display session information -->

<% if ( session.isNew() ) { %>

This is a new session ! <BR>

<%} else {

// get the username parameter an save it!, by calling the function below,

// the the form submit request parameter, named "USERNAME" is being save

// as a session variable.. see displaySavedName.jsp for retrieval.

session.setAttribute("USERNAME",request.getParameter("USERNAME"));

%>

This is an existing session; created

<%=new java.util.Date(session.getCreationTime())%> <BR>

<!-- since it is not new provide a link to view the saved variable -->

<A href='displaySavedName.jsp'>Show Saved Name</A>

<%}%>

<!-- basic HTML stuff, but notice that we call the jsp page on submit -->

<FORM method=POST action='enterName.jsp'>

Enter the name to associate to this session

<INPUT type='TEXT' name='USERNAME' size='20'> <BR/>

<INPUT type='SUBMIT' value='save name as session variable'>

</FORM>

</body>

</html>

Regards ,

Venkat P

Former Member
0 Kudos

Hi Venkat,

In Web Dynpro you can get the session id by using below code:-

HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();

HttpSession session = request.getSession();

return session.getId();

Is this what you are looking for?

Regards,

Swati

former_member1193316
Participant
0 Kudos

can you please guide me how to find my portal session id....

the above code is also not worked for me to solve out the issue...

please.................

former_member1193316
Participant
0 Kudos

when i tried the above code i m getting below error

IWebContextAdapter is not resolved or not a type

i import organize imports also...still i couldnt able to resolve this issue