on 03-30-2006 1:37 PM
I apologize if this has been discussed before. However, I could not find the answer on the forum.
I have read on the forum it is not possible to access the HttpSession object from Web Dynpro.
What is the best approach then to store objects per browser session?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Harm,
It is not true that you cannot access the HttpSession object in a Web Dynpro, the thing is that is not supported by SAP, here is the code.
HttpServletRequest request = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletRequest();
HttpServletResponse response = ((IWebContextAdapter) WDWebContextAdapter.getWebContextAdapter()).getHttpServletResponse();
HttpSession sesion = request.getSession();
For this you will have to add servlet.jar to your build path.
A better way to mannage data is using the Context of a Web Dynpro View o Controller, I suggest you read this document
<a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial%20on%20creating%20an%20extended%20web%20dynpro%20application%20-%202.htm">https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial%20on%20creating%20an%20extended%20web%20dynpro%20application%20-%202.htm</a>
which has the basic step for creating context and mapping it.
Regards.
*Remember rewarding point if the ansewear was helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.