Ray Auge Vor 16 Jahren I just updated the Wiki with and example of how this might be used from either XSL or VM templates.<a href="http://wiki.liferay.com/index.php/Journal_Internal_API#Request_Handling_Example">http://wiki.liferay.com/index.php/Journal_Internal_API#Request_Handling_Example</a>Enjoy! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen James Min Ray Auge Vor 15 Jahren awesome Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen simon tuffle Ray Auge Vor 14 Jahren hai Ray,Could you please assist me in retrieving the portletsession variable kept in jsp into .vm file. I tried in the below fashion but unable to get the value..#set ($somePSAttribute = $request.get('portlet-session').get('keyname').get('com.liferay.util.servlet.SessionMessages'))or i need to write an additional code in any .xml files? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé simon tuffle Vor 13 Jahren $request.portlet-session gets you the session Map. but there are two paths from here: portlet-attributes, and application-attributes to emulate the PortletSession.PORTLET_SCOPE and PortletSession.APPLICATION_SCOPE respectively.Therefore you would have something like:#set ($attribute = $request.portlet-session.portlet-attributes.keyname)Note: the returned type is always String, so you may have to parse that result of the object was serializable, but not a String or primitive or primitive Wrapper class object. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Christian De Vera Talampas Ray Auge Vor 13 Jahren Hi Ray!Sorry for posting in a wrong thread. Do you have example on how to initialize and manipulate arrays in velocity?Thanks Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé Christian De Vera Talampas Vor 13 Jahren Arrays are handled automatically in Velocity. this is how you create an empty array: #set ($arr = []) a non-empty array: #set ($arr2 = [1, 2, 3])But whenever you think "array", you should really think "ArrayList", which means that manipulation uses the java.util.List interface: $arr2.add(4), $arr2.size(), etcBut where you are passing this to a method call that really requires an array, velocity will autobox down from ArrayList to plain array, as long as the contents of the ArrayList fit the parameter array type of the method. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Christian De Vera Talampas Ray Augé Vor 13 Jahren thanks ray! however i have other queries. i tried to use this line $arr2.add(1) but i noticed that it returns a value "true" (probably a flag). how can i prevent that from happening? i just want to insert an element and access it. plus if i want to access an array element of a certain index, how do i do that? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé Christian De Vera Talampas Vor 13 Jahren The only way that I have found to do this in velocity was to fudge a void method call using #set:#set ($void = $list.add($thing)) Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren ray plz help me to get user id in a simple jsp portlet... im very new to liferay.. plz help me Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren request.getRemoteUser() Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren while im useing <%=request.getRemoteUser()%> im getting null value ... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren Please note that the request must pass through the portal in order to get the proper result.A direct request such as /context-portlet/my.jsp will not work. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren thanks mr. ray.. i got the user attributes in my jsp portlet.. thank you so much... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen jeff gerbracht Ray Augé Vor 13 Jahren I'm struggling with arrays in Velocity, specifically, I can't get the method TagsEntryLocalService.getEntryIds() to work though getEntry works fine. I've the following code in a template (note that in reality, each #set is on it's own line)#set( $tags=["gallery"])#set ($tagsEntryService= $serviceLocator.findService("com.liferay.portlet.tags.service.TagsEntryLocalService"))#set ($entries=$tagsEntryService.getEntryIds($getterUtil.getLong($companyId),$tags))#set ($entryid=$tagsEntryService.getEntry($getterUtil.getLong($companyId),$tags.get(0)).getEntryId())tags=$tagsentries = $entries entryID=$entryidwhich displaystags=[gallery] entries = $entries entryID=717820and it should be something liketags=[gallery] entries = [717820] entryID=717820Any Ideas??? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
James Min Ray Auge Vor 15 Jahren awesome Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
simon tuffle Ray Auge Vor 14 Jahren hai Ray,Could you please assist me in retrieving the portletsession variable kept in jsp into .vm file. I tried in the below fashion but unable to get the value..#set ($somePSAttribute = $request.get('portlet-session').get('keyname').get('com.liferay.util.servlet.SessionMessages'))or i need to write an additional code in any .xml files? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé simon tuffle Vor 13 Jahren $request.portlet-session gets you the session Map. but there are two paths from here: portlet-attributes, and application-attributes to emulate the PortletSession.PORTLET_SCOPE and PortletSession.APPLICATION_SCOPE respectively.Therefore you would have something like:#set ($attribute = $request.portlet-session.portlet-attributes.keyname)Note: the returned type is always String, so you may have to parse that result of the object was serializable, but not a String or primitive or primitive Wrapper class object. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Ray Augé simon tuffle Vor 13 Jahren $request.portlet-session gets you the session Map. but there are two paths from here: portlet-attributes, and application-attributes to emulate the PortletSession.PORTLET_SCOPE and PortletSession.APPLICATION_SCOPE respectively.Therefore you would have something like:#set ($attribute = $request.portlet-session.portlet-attributes.keyname)Note: the returned type is always String, so you may have to parse that result of the object was serializable, but not a String or primitive or primitive Wrapper class object. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Christian De Vera Talampas Ray Auge Vor 13 Jahren Hi Ray!Sorry for posting in a wrong thread. Do you have example on how to initialize and manipulate arrays in velocity?Thanks Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé Christian De Vera Talampas Vor 13 Jahren Arrays are handled automatically in Velocity. this is how you create an empty array: #set ($arr = []) a non-empty array: #set ($arr2 = [1, 2, 3])But whenever you think "array", you should really think "ArrayList", which means that manipulation uses the java.util.List interface: $arr2.add(4), $arr2.size(), etcBut where you are passing this to a method call that really requires an array, velocity will autobox down from ArrayList to plain array, as long as the contents of the ArrayList fit the parameter array type of the method. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Christian De Vera Talampas Ray Augé Vor 13 Jahren thanks ray! however i have other queries. i tried to use this line $arr2.add(1) but i noticed that it returns a value "true" (probably a flag). how can i prevent that from happening? i just want to insert an element and access it. plus if i want to access an array element of a certain index, how do i do that? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé Christian De Vera Talampas Vor 13 Jahren The only way that I have found to do this in velocity was to fudge a void method call using #set:#set ($void = $list.add($thing)) Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren ray plz help me to get user id in a simple jsp portlet... im very new to liferay.. plz help me Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren request.getRemoteUser() Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren while im useing <%=request.getRemoteUser()%> im getting null value ... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren Please note that the request must pass through the portal in order to get the proper result.A direct request such as /context-portlet/my.jsp will not work. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren thanks mr. ray.. i got the user attributes in my jsp portlet.. thank you so much... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen jeff gerbracht Ray Augé Vor 13 Jahren I'm struggling with arrays in Velocity, specifically, I can't get the method TagsEntryLocalService.getEntryIds() to work though getEntry works fine. I've the following code in a template (note that in reality, each #set is on it's own line)#set( $tags=["gallery"])#set ($tagsEntryService= $serviceLocator.findService("com.liferay.portlet.tags.service.TagsEntryLocalService"))#set ($entries=$tagsEntryService.getEntryIds($getterUtil.getLong($companyId),$tags))#set ($entryid=$tagsEntryService.getEntry($getterUtil.getLong($companyId),$tags.get(0)).getEntryId())tags=$tagsentries = $entries entryID=$entryidwhich displaystags=[gallery] entries = $entries entryID=717820and it should be something liketags=[gallery] entries = [717820] entryID=717820Any Ideas??? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Ray Augé Christian De Vera Talampas Vor 13 Jahren Arrays are handled automatically in Velocity. this is how you create an empty array: #set ($arr = []) a non-empty array: #set ($arr2 = [1, 2, 3])But whenever you think "array", you should really think "ArrayList", which means that manipulation uses the java.util.List interface: $arr2.add(4), $arr2.size(), etcBut where you are passing this to a method call that really requires an array, velocity will autobox down from ArrayList to plain array, as long as the contents of the ArrayList fit the parameter array type of the method. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Christian De Vera Talampas Ray Augé Vor 13 Jahren thanks ray! however i have other queries. i tried to use this line $arr2.add(1) but i noticed that it returns a value "true" (probably a flag). how can i prevent that from happening? i just want to insert an element and access it. plus if i want to access an array element of a certain index, how do i do that? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé Christian De Vera Talampas Vor 13 Jahren The only way that I have found to do this in velocity was to fudge a void method call using #set:#set ($void = $list.add($thing)) Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren ray plz help me to get user id in a simple jsp portlet... im very new to liferay.. plz help me Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren request.getRemoteUser() Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren while im useing <%=request.getRemoteUser()%> im getting null value ... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren Please note that the request must pass through the portal in order to get the proper result.A direct request such as /context-portlet/my.jsp will not work. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren thanks mr. ray.. i got the user attributes in my jsp portlet.. thank you so much... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen jeff gerbracht Ray Augé Vor 13 Jahren I'm struggling with arrays in Velocity, specifically, I can't get the method TagsEntryLocalService.getEntryIds() to work though getEntry works fine. I've the following code in a template (note that in reality, each #set is on it's own line)#set( $tags=["gallery"])#set ($tagsEntryService= $serviceLocator.findService("com.liferay.portlet.tags.service.TagsEntryLocalService"))#set ($entries=$tagsEntryService.getEntryIds($getterUtil.getLong($companyId),$tags))#set ($entryid=$tagsEntryService.getEntry($getterUtil.getLong($companyId),$tags.get(0)).getEntryId())tags=$tagsentries = $entries entryID=$entryidwhich displaystags=[gallery] entries = $entries entryID=717820and it should be something liketags=[gallery] entries = [717820] entryID=717820Any Ideas??? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Christian De Vera Talampas Ray Augé Vor 13 Jahren thanks ray! however i have other queries. i tried to use this line $arr2.add(1) but i noticed that it returns a value "true" (probably a flag). how can i prevent that from happening? i just want to insert an element and access it. plus if i want to access an array element of a certain index, how do i do that? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé Christian De Vera Talampas Vor 13 Jahren The only way that I have found to do this in velocity was to fudge a void method call using #set:#set ($void = $list.add($thing)) Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren ray plz help me to get user id in a simple jsp portlet... im very new to liferay.. plz help me Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren request.getRemoteUser() Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren while im useing <%=request.getRemoteUser()%> im getting null value ... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren Please note that the request must pass through the portal in order to get the proper result.A direct request such as /context-portlet/my.jsp will not work. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren thanks mr. ray.. i got the user attributes in my jsp portlet.. thank you so much... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Ray Augé Christian De Vera Talampas Vor 13 Jahren The only way that I have found to do this in velocity was to fudge a void method call using #set:#set ($void = $list.add($thing)) Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren ray plz help me to get user id in a simple jsp portlet... im very new to liferay.. plz help me Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren request.getRemoteUser() Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren while im useing <%=request.getRemoteUser()%> im getting null value ... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren Please note that the request must pass through the portal in order to get the proper result.A direct request such as /context-portlet/my.jsp will not work. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren thanks mr. ray.. i got the user attributes in my jsp portlet.. thank you so much... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
prabhakar m Ray Augé Vor 13 Jahren ray plz help me to get user id in a simple jsp portlet... im very new to liferay.. plz help me Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren request.getRemoteUser() Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren while im useing <%=request.getRemoteUser()%> im getting null value ... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren Please note that the request must pass through the portal in order to get the proper result.A direct request such as /context-portlet/my.jsp will not work. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren thanks mr. ray.. i got the user attributes in my jsp portlet.. thank you so much... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Ray Augé prabhakar m Vor 13 Jahren request.getRemoteUser() Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren while im useing <%=request.getRemoteUser()%> im getting null value ... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren Please note that the request must pass through the portal in order to get the proper result.A direct request such as /context-portlet/my.jsp will not work. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren thanks mr. ray.. i got the user attributes in my jsp portlet.. thank you so much... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
prabhakar m Ray Augé Vor 13 Jahren while im useing <%=request.getRemoteUser()%> im getting null value ... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé prabhakar m Vor 13 Jahren Please note that the request must pass through the portal in order to get the proper result.A direct request such as /context-portlet/my.jsp will not work. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren thanks mr. ray.. i got the user attributes in my jsp portlet.. thank you so much... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Ray Augé prabhakar m Vor 13 Jahren Please note that the request must pass through the portal in order to get the proper result.A direct request such as /context-portlet/my.jsp will not work. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen prabhakar m Ray Augé Vor 13 Jahren thanks mr. ray.. i got the user attributes in my jsp portlet.. thank you so much... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
prabhakar m Ray Augé Vor 13 Jahren thanks mr. ray.. i got the user attributes in my jsp portlet.. thank you so much... Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
jeff gerbracht Ray Augé Vor 13 Jahren I'm struggling with arrays in Velocity, specifically, I can't get the method TagsEntryLocalService.getEntryIds() to work though getEntry works fine. I've the following code in a template (note that in reality, each #set is on it's own line)#set( $tags=["gallery"])#set ($tagsEntryService= $serviceLocator.findService("com.liferay.portlet.tags.service.TagsEntryLocalService"))#set ($entries=$tagsEntryService.getEntryIds($getterUtil.getLong($companyId),$tags))#set ($entryid=$tagsEntryService.getEntry($getterUtil.getLong($companyId),$tags.get(0)).getEntryId())tags=$tagsentries = $entries entryID=$entryidwhich displaystags=[gallery] entries = $entries entryID=717820and it should be something liketags=[gallery] entries = [717820] entryID=717820Any Ideas??? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Kuldeep Bhati Vor 12 Jahren Hi All,I created a custom.jsp file in which I have simple HttpSession variable as below<code>session.setAttribute("loginname", loginname);</code>My objective is to display this loginname session variable in my portal_normal.vm file, I have also tried using the following way,<code>#set( $session = $request.getSession(true) )#set( $name = $session.getAttribute(loginname) )$name</code>But still no idea, how to access HttpSession data in the velocity file, Please help on this. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen David García González Kuldeep Bhati Vor 12 Jahren Hi Simon, I am trying to do the same as you in Liferay 6, but I am unable to get it.Did you finally get the portlet variable you needed?Thanks! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen KK rajput David García González Vor 12 Jahren Hi Ray , is it working in liferay 6 ?? I am unable to make it work ?? Below is my codein Jsp :renderRequest.getPortletSession().setAttribute("attr1", "attr1");In vm :#set ($customAttribute = $request.getSession().getAttribute("attr1"))$customAttribute#set ($somePSAttribute = $request.get('portlet-session').get('portlet-attributes').get('attr1'))$somePSAttribute#set ($someASAttribute = $request.get('portlet-session').get('application-attributes').get('attr1'))$someASAttributebut none is working Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé KK rajput Vor 12 Jahren Since you didn't specify the scope for the attribute, it will be a portlet attribute value and only the SAME portlet will be able to see it, therefore the web content portlet won't be able to see it.To share the attribute you need to set it in the application scope:renderRequest.getPortletSession().setAttribute("attr1", "attr1", PortletSession.APPLICATION_SCOPE);then you'll be able to see it like this:#set ($somePSAttribute = $request.portlet-session.application-attributes.attr1) Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
David García González Kuldeep Bhati Vor 12 Jahren Hi Simon, I am trying to do the same as you in Liferay 6, but I am unable to get it.Did you finally get the portlet variable you needed?Thanks! Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen KK rajput David García González Vor 12 Jahren Hi Ray , is it working in liferay 6 ?? I am unable to make it work ?? Below is my codein Jsp :renderRequest.getPortletSession().setAttribute("attr1", "attr1");In vm :#set ($customAttribute = $request.getSession().getAttribute("attr1"))$customAttribute#set ($somePSAttribute = $request.get('portlet-session').get('portlet-attributes').get('attr1'))$somePSAttribute#set ($someASAttribute = $request.get('portlet-session').get('application-attributes').get('attr1'))$someASAttributebut none is working Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé KK rajput Vor 12 Jahren Since you didn't specify the scope for the attribute, it will be a portlet attribute value and only the SAME portlet will be able to see it, therefore the web content portlet won't be able to see it.To share the attribute you need to set it in the application scope:renderRequest.getPortletSession().setAttribute("attr1", "attr1", PortletSession.APPLICATION_SCOPE);then you'll be able to see it like this:#set ($somePSAttribute = $request.portlet-session.application-attributes.attr1) Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
KK rajput David García González Vor 12 Jahren Hi Ray , is it working in liferay 6 ?? I am unable to make it work ?? Below is my codein Jsp :renderRequest.getPortletSession().setAttribute("attr1", "attr1");In vm :#set ($customAttribute = $request.getSession().getAttribute("attr1"))$customAttribute#set ($somePSAttribute = $request.get('portlet-session').get('portlet-attributes').get('attr1'))$somePSAttribute#set ($someASAttribute = $request.get('portlet-session').get('application-attributes').get('attr1'))$someASAttributebut none is working Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé KK rajput Vor 12 Jahren Since you didn't specify the scope for the attribute, it will be a portlet attribute value and only the SAME portlet will be able to see it, therefore the web content portlet won't be able to see it.To share the attribute you need to set it in the application scope:renderRequest.getPortletSession().setAttribute("attr1", "attr1", PortletSession.APPLICATION_SCOPE);then you'll be able to see it like this:#set ($somePSAttribute = $request.portlet-session.application-attributes.attr1) Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Ray Augé KK rajput Vor 12 Jahren Since you didn't specify the scope for the attribute, it will be a portlet attribute value and only the SAME portlet will be able to see it, therefore the web content portlet won't be able to see it.To share the attribute you need to set it in the application scope:renderRequest.getPortletSession().setAttribute("attr1", "attr1", PortletSession.APPLICATION_SCOPE);then you'll be able to see it like this:#set ($somePSAttribute = $request.portlet-session.application-attributes.attr1) Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Max Gabrielsson Vor 12 Jahren Is there a way to access the action phase from a journal article. So I can set a session variable and other portlets will render accordingly? The scope would be a mvc portlet that shows detail for an Item which listens to a session variable. I want to be able to do a journal article that shows a link to the item and the details portlet will render that item from the session variable. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
suresh yadagiri Vor 10 Jahren How can we get httpsession in web content VM template? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen Ray Augé suresh yadagiri Vor 10 Jahren You can't! You can only get a readonly map which represents any trivially serializable contents it contains. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
Ray Augé suresh yadagiri Vor 10 Jahren You can't! You can only get a readonly map which represents any trivially serializable contents it contains. Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen
suresh yadagiri Vor 10 Jahren okay. we need to access some data (ex: EmployeeDetails Bean) we get in AutoLogin hook inside content display portlet. As we have only HttpRequest and HttpResponse in Auto Login hook, i am not sure how to send data to VM template. any suggestions? Melden Sie sich an, um auf diesen Beitrag zu antworten. Antworten als... Abbrechen