Alvaro Del Castillo 15 年之前 Really nice Ray! A great starting point to understand personalization. I hope some of these contents reach the developer guide. 请登录以投票。 以……回复 取消 Ray Augé Alvaro Del Castillo 15 年之前 Thanks! 请登录以投票。 以……回复 取消
Thomas Ballerstedt 15 年之前 I really like your [HOWTO]'s. Thank you very much! 请登录以投票。 以……回复 取消 Ray Augé Thomas Ballerstedt 15 年之前 Much appreciated! 请登录以投票。 以……回复 取消
Hans-Georg Menz 15 年之前 I like this HOWTO very much, but I still have a question. Maybe you can help me with that. Do you know how to get the req in ThemeDisplay themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY);in an ICEFaces portlet? 请登录以投票。 以……回复 取消 Ray Augé Hans-Georg Menz 15 年之前 Thank you very much!I'm not a *Faces export by any means, BUT I think that in general you can do something like this:FacesContext fCtx = FacesContext.getCurrentInstance();PortletRequest req = (PortletRequest)fCtx.getExternalContext().getRequest();_themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY);Please note that a common mistake with *Faces is that "some" requests aren't actually handled by the portal. Those will never have portal attributes, like "ThemeDisplay" in them, unless you add some sort of special handling. 请登录以投票。 以……回复 取消 Ruben Gerad Mathew Hans-Georg Menz 13 年之前 Insert the following in web.xml <context-param> <param-name>com.icesoft.faces.hiddenPortletAttributes</param-name> <param-value>THEME_DISPLAY</param-value> </context-param>Then you can access Theme Display by adding the code in your Managed Bean:avax.portlet.PortletRequest req = (javax.portlet.PortletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();RenderRequest renderRequest = (RenderRequest) req.getAttribute("javax.portlet.request");ThemeDisplay _theme = (ThemeDisplay) req.getAttribute(WebKeys.THEME_DISPLAY);System.err.println(_theme.getCompany() + " : " + _theme.getCompanyId());System.out.println(_theme.getUser().getFullName() + " : " + _theme.getUserId()); 请登录以投票。 以……回复 取消
Ray Augé Hans-Georg Menz 15 年之前 Thank you very much!I'm not a *Faces export by any means, BUT I think that in general you can do something like this:FacesContext fCtx = FacesContext.getCurrentInstance();PortletRequest req = (PortletRequest)fCtx.getExternalContext().getRequest();_themeDisplay = (ThemeDisplay)req.getAttribute(WebKeys.THEME_DISPLAY);Please note that a common mistake with *Faces is that "some" requests aren't actually handled by the portal. Those will never have portal attributes, like "ThemeDisplay" in them, unless you add some sort of special handling. 请登录以投票。 以……回复 取消
Ruben Gerad Mathew Hans-Georg Menz 13 年之前 Insert the following in web.xml <context-param> <param-name>com.icesoft.faces.hiddenPortletAttributes</param-name> <param-value>THEME_DISPLAY</param-value> </context-param>Then you can access Theme Display by adding the code in your Managed Bean:avax.portlet.PortletRequest req = (javax.portlet.PortletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();RenderRequest renderRequest = (RenderRequest) req.getAttribute("javax.portlet.request");ThemeDisplay _theme = (ThemeDisplay) req.getAttribute(WebKeys.THEME_DISPLAY);System.err.println(_theme.getCompany() + " : " + _theme.getCompanyId());System.out.println(_theme.getUser().getFullName() + " : " + _theme.getUserId()); 请登录以投票。 以……回复 取消
aligator fred 15 年之前 <b>No tag "user-display" defined in tag library imported with prefix "liferay-ui"</b> error..there is no file liferay-plugin-package.properties either ? ... 请登录以投票。 以……回复 取消 aligator fred aligator fred 15 年之前 as im the only unhappy one here im hoping its just me being a liferay anoying noob 请登录以投票。 以……回复 取消 Ray Augé aligator fred 15 年之前 What environment are you working with a portlet or a theme? In ext or SDK? 请登录以投票。 以……回复 取消 M Murali Krishna Reddy Ray Augé 15 年之前 Hi Ray, I did all the settings, but I always get null for all the objects like themeDisplay and user etc. 请登录以投票。 以……回复 取消 auditya manikanta vadrevu M Murali Krishna Reddy 15 年之前 hi murali, i have followed the steps and i have got the name and userid. specify the changes what u have done 请登录以投票。 以……回复 取消 Jane Eriksson Ray Augé 15 年之前 Hi Ray,I am trying to get this working, but I get Given Name : null.First of all I am working with a portlet and I am using SDK 5.2.2. I am not sure where to put the <portlet-app> configurations. Is there something that is already written somewhere or shall I write it in some file, in that case, which one. If it is already written, what else can be wrong?Thanks! 请登录以投票。 以……回复 取消 Ray Augé Jane Eriksson 15 年之前 The elements under "portlet-app" go in the portlet.xml file of your plugin.See the JSP spec for relevant details about that (or the examples above). 请登录以投票。 以……回复 取消 Jane Eriksson Ray Augé 14 年之前 I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. 请登录以投票。 以……回复 取消
aligator fred aligator fred 15 年之前 as im the only unhappy one here im hoping its just me being a liferay anoying noob 请登录以投票。 以……回复 取消 Ray Augé aligator fred 15 年之前 What environment are you working with a portlet or a theme? In ext or SDK? 请登录以投票。 以……回复 取消 M Murali Krishna Reddy Ray Augé 15 年之前 Hi Ray, I did all the settings, but I always get null for all the objects like themeDisplay and user etc. 请登录以投票。 以……回复 取消 auditya manikanta vadrevu M Murali Krishna Reddy 15 年之前 hi murali, i have followed the steps and i have got the name and userid. specify the changes what u have done 请登录以投票。 以……回复 取消 Jane Eriksson Ray Augé 15 年之前 Hi Ray,I am trying to get this working, but I get Given Name : null.First of all I am working with a portlet and I am using SDK 5.2.2. I am not sure where to put the <portlet-app> configurations. Is there something that is already written somewhere or shall I write it in some file, in that case, which one. If it is already written, what else can be wrong?Thanks! 请登录以投票。 以……回复 取消 Ray Augé Jane Eriksson 15 年之前 The elements under "portlet-app" go in the portlet.xml file of your plugin.See the JSP spec for relevant details about that (or the examples above). 请登录以投票。 以……回复 取消 Jane Eriksson Ray Augé 14 年之前 I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. 请登录以投票。 以……回复 取消
Ray Augé aligator fred 15 年之前 What environment are you working with a portlet or a theme? In ext or SDK? 请登录以投票。 以……回复 取消 M Murali Krishna Reddy Ray Augé 15 年之前 Hi Ray, I did all the settings, but I always get null for all the objects like themeDisplay and user etc. 请登录以投票。 以……回复 取消 auditya manikanta vadrevu M Murali Krishna Reddy 15 年之前 hi murali, i have followed the steps and i have got the name and userid. specify the changes what u have done 请登录以投票。 以……回复 取消 Jane Eriksson Ray Augé 15 年之前 Hi Ray,I am trying to get this working, but I get Given Name : null.First of all I am working with a portlet and I am using SDK 5.2.2. I am not sure where to put the <portlet-app> configurations. Is there something that is already written somewhere or shall I write it in some file, in that case, which one. If it is already written, what else can be wrong?Thanks! 请登录以投票。 以……回复 取消 Ray Augé Jane Eriksson 15 年之前 The elements under "portlet-app" go in the portlet.xml file of your plugin.See the JSP spec for relevant details about that (or the examples above). 请登录以投票。 以……回复 取消 Jane Eriksson Ray Augé 14 年之前 I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. 请登录以投票。 以……回复 取消
M Murali Krishna Reddy Ray Augé 15 年之前 Hi Ray, I did all the settings, but I always get null for all the objects like themeDisplay and user etc. 请登录以投票。 以……回复 取消 auditya manikanta vadrevu M Murali Krishna Reddy 15 年之前 hi murali, i have followed the steps and i have got the name and userid. specify the changes what u have done 请登录以投票。 以……回复 取消
auditya manikanta vadrevu M Murali Krishna Reddy 15 年之前 hi murali, i have followed the steps and i have got the name and userid. specify the changes what u have done 请登录以投票。 以……回复 取消
Jane Eriksson Ray Augé 15 年之前 Hi Ray,I am trying to get this working, but I get Given Name : null.First of all I am working with a portlet and I am using SDK 5.2.2. I am not sure where to put the <portlet-app> configurations. Is there something that is already written somewhere or shall I write it in some file, in that case, which one. If it is already written, what else can be wrong?Thanks! 请登录以投票。 以……回复 取消 Ray Augé Jane Eriksson 15 年之前 The elements under "portlet-app" go in the portlet.xml file of your plugin.See the JSP spec for relevant details about that (or the examples above). 请登录以投票。 以……回复 取消 Jane Eriksson Ray Augé 14 年之前 I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. 请登录以投票。 以……回复 取消
Ray Augé Jane Eriksson 15 年之前 The elements under "portlet-app" go in the portlet.xml file of your plugin.See the JSP spec for relevant details about that (or the examples above). 请登录以投票。 以……回复 取消 Jane Eriksson Ray Augé 14 年之前 I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. 请登录以投票。 以……回复 取消
Jane Eriksson Ray Augé 14 年之前 I did try to put it there but I still get the same answer, Given name: null.Does it matter where in the file I put it? I have tried both in the top between the <portlet-app>-tags and in the end, still between them, but nothing works. 请登录以投票。 以……回复 取消
Pierre Denis 15 年之前 Thanks for this post. I have a question on a topic related to personalization.When a logged user adds, positions or emove a portlet on a page of the portal, the page configuration is persisted somewhere; so the user, for his next session, will retrieve the his set of portlets, in his specific layout. For example,- user Joe has a News portlet on the left and Wheather portlet on the right;- user Sarah has a Weather portlet on top and a Map Viewer portlet on the bottom.The same applies for the specific list of pages, with chosen layout templates, configured by each user.What is exactly the name for this kind of settings (in Liferay or elsewhere)?Is this standardized (JSR-168 or JSR-286)?To be clear, my question is at the level of portal page. I DON'T speak here about- preferences/configuration of one specific portlet- Liferay themes- user profiles (name, address, etc)Thanks 请登录以投票。 以……回复 取消
Raju A K 15 年之前 Hi Ray,Is it possible to achieve rules based personalization or say unified user profile attributes like one available with weblogic ?ThanksRaju 请登录以投票。 以……回复 取消 Ray Augé Raju A K 15 年之前 Do you have some references I can read on both these topics? I've never used the terminology, so I can't really comment on whether we can or can't do it. Thanks 请登录以投票。 以……回复 取消 Raju A K Ray Augé 15 年之前 Sorry for delay.Rules based personalization: based on embedded business rules like say if A then B defined say using a drools rules engine or like web sphere which has a rules engine as part of personalization .Useful link:http://www.atgsolutionsstrategy.com/2008/09/personalization.htmlUnified user Profile is more Weblogic Portal specific which allows to create and manage unified user profiles for personalization.Heres a useful bea link:http://edocs.bea.com/wlp/docs92/users/uup.htmlDoes liferay support use of say drools rules engine just like it supports jBPM for process management .ThanksRaju 请登录以投票。 以……回复 取消
Ray Augé Raju A K 15 年之前 Do you have some references I can read on both these topics? I've never used the terminology, so I can't really comment on whether we can or can't do it. Thanks 请登录以投票。 以……回复 取消 Raju A K Ray Augé 15 年之前 Sorry for delay.Rules based personalization: based on embedded business rules like say if A then B defined say using a drools rules engine or like web sphere which has a rules engine as part of personalization .Useful link:http://www.atgsolutionsstrategy.com/2008/09/personalization.htmlUnified user Profile is more Weblogic Portal specific which allows to create and manage unified user profiles for personalization.Heres a useful bea link:http://edocs.bea.com/wlp/docs92/users/uup.htmlDoes liferay support use of say drools rules engine just like it supports jBPM for process management .ThanksRaju 请登录以投票。 以……回复 取消
Raju A K Ray Augé 15 年之前 Sorry for delay.Rules based personalization: based on embedded business rules like say if A then B defined say using a drools rules engine or like web sphere which has a rules engine as part of personalization .Useful link:http://www.atgsolutionsstrategy.com/2008/09/personalization.htmlUnified user Profile is more Weblogic Portal specific which allows to create and manage unified user profiles for personalization.Heres a useful bea link:http://edocs.bea.com/wlp/docs92/users/uup.htmlDoes liferay support use of say drools rules engine just like it supports jBPM for process management .ThanksRaju 请登录以投票。 以……回复 取消
nidhi singh 15 年之前 hii got good idea about personalization, but i have 1 question that, if i want to change the theme users to user how will i do? 请登录以投票。 以……回复 取消 Michael Poznecki nidhi singh 15 年之前 How do you display any of the themeDisplay values?Michael 请登录以投票。 以……回复 取消 Ray Augé Michael Poznecki 15 年之前 I'm not sure what you're asking! Can you explain what you are trying to do? 请登录以投票。 以……回复 取消 Ray Augé nidhi singh 15 年之前 I'll make a quick blog post about this since I now have 2 inquires of how to do this.Coming soon! 请登录以投票。 以……回复 取消 touka touka Ray Augé 13 年之前 Hi Raythank you for the HOWTObut i still have null when i use liferay.user.nickName !!!!Any idea for this!!! 请登录以投票。 以……回复 取消 Ray Augé touka touka 13 年之前 How are you using that field? I don't know if that field is even defined! It should be "user.name.nickName" 请登录以投票。 以……回复 取消
Michael Poznecki nidhi singh 15 年之前 How do you display any of the themeDisplay values?Michael 请登录以投票。 以……回复 取消 Ray Augé Michael Poznecki 15 年之前 I'm not sure what you're asking! Can you explain what you are trying to do? 请登录以投票。 以……回复 取消
Ray Augé Michael Poznecki 15 年之前 I'm not sure what you're asking! Can you explain what you are trying to do? 请登录以投票。 以……回复 取消
Ray Augé nidhi singh 15 年之前 I'll make a quick blog post about this since I now have 2 inquires of how to do this.Coming soon! 请登录以投票。 以……回复 取消 touka touka Ray Augé 13 年之前 Hi Raythank you for the HOWTObut i still have null when i use liferay.user.nickName !!!!Any idea for this!!! 请登录以投票。 以……回复 取消 Ray Augé touka touka 13 年之前 How are you using that field? I don't know if that field is even defined! It should be "user.name.nickName" 请登录以投票。 以……回复 取消
touka touka Ray Augé 13 年之前 Hi Raythank you for the HOWTObut i still have null when i use liferay.user.nickName !!!!Any idea for this!!! 请登录以投票。 以……回复 取消 Ray Augé touka touka 13 年之前 How are you using that field? I don't know if that field is even defined! It should be "user.name.nickName" 请登录以投票。 以……回复 取消
Ray Augé touka touka 13 年之前 How are you using that field? I don't know if that field is even defined! It should be "user.name.nickName" 请登录以投票。 以……回复 取消
Aravind Kumar 15 年之前 Thanks for the post Ray. I would like to fetch the Liferay logged User's UserGroup Names. How can I do that? 请登录以投票。 以……回复 取消 Ray Augé Aravind Kumar 15 年之前 List<UserGroup> com.liferay.portal.service.UserGroupLocalServiceUtil.getUserUserGroups(long userId) throws SystemException; 请登录以投票。 以……回复 取消
Ray Augé Aravind Kumar 15 年之前 List<UserGroup> com.liferay.portal.service.UserGroupLocalServiceUtil.getUserUserGroups(long userId) throws SystemException; 请登录以投票。 以……回复 取消
Jeff M. Tackett 14 年之前 I was trying to figure out how to get the phone number of a user. I am using the themeDisplay object and I just can't find the phone numbers. 请登录以投票。 以……回复 取消 Jeff M. Tackett Jeff M. Tackett 14 年之前 Nevermind, I have found a way to get the phone number. 请登录以投票。 以……回复 取消
Jeff M. Tackett Jeff M. Tackett 14 年之前 Nevermind, I have found a way to get the phone number. 请登录以投票。 以……回复 取消
Garry Seto 14 年之前 Hi Ray,Very helpful post! But I am having trouble with one specific attribute, Job Title. I've followed the code exactly and all the other attributes are retrieved correctly but Job Title keeps on coming back NULL. I am using LifeRay 5.2.2. Please let me know if you've or anyone has encountered this before or if this is a known issue.Thanks,Garry 请登录以投票。 以……回复 取消
Ruben Gerad Mathew 13 年之前 Hi, I have a question with regard to personalization, since portlets reside on the same JVM can I use the static Util class which are also available through spring to create and remove content like shown below using my Icefaces portlets Managed Bean class:public class KeyAccess { public void invoke() { try { javax.portlet.PortletRequest req = (javax.portlet.PortletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); RenderRequest renderRequest = (RenderRequest) req.getAttribute("javax.portlet.request"); ThemeDisplay _theme = (ThemeDisplay) req.getAttribute(WebKeys.THEME_DISPLAY); System.err.println(_theme.getCompany() + " : " + _theme.getCompanyId()); System.out.println(_theme.getUser().getFullName() + " : " + _theme.getUserId()); com.liferay.portlet.announcements.service.AnnouncementsEntryLocalServiceUtil ann = new AnnouncementsEntryLocalServiceUtil(); com.liferay.portlet.messageboards.service.MBMessageLocalServiceUtil msg = new MBMessageLocalServiceUtil(); MBMessage message = msg.createMBMessage(1001); message.setBody("My Simple Message"); message.setSubject("TEST Message"); message.setCompanyId(_theme.getCompanyId()); message.setUserId(_theme.getUserId()); message.setUserName(_theme.getUser().getFullName()); message.setCategoryId(1); msg.updateMBMessage(message); // AnnouncementsEntry entry = ann.createAnnouncementsEntry(109);// Calendar cal = Calendar.getInstance();// entry.setCompanyId(_theme.getCompanyId());// entry.setUserId(_theme.getUserId());// entry.setAlert(true);// entry.setContent("adfads asdfasdf asdfsadf asdfasdf");// entry.setCreateDate(cal.getTime());// entry.setDisplayDate(cal.getTime());// ann.updateAnnouncementsEntry(entry); } catch (SystemException ex) { Logger.getLogger(KeyAccess.class.getName()).log(Level.SEVERE, null, ex); } }} 请登录以投票。 以……回复 取消 Ray Augé Ruben Gerad Mathew 13 年之前 Not sure why you have to get the RenderRequest from the already obtained PortletRequest (should both the be the same objects), but perhaps this is a quirck with faces I'm not aware of...Otherwise try this:----------------------------------------try{ RenderRequest renderRequest = ... ThemeDisplay _theme = (ThemeDisplay)renderRequest.getAttribute( WebKeys.THEME_DISPLAY); List<ObjectValuePair<String, byte[]>> files = Collections.EMPTY_LIST; ServiceContext serviceContext = ServiceContextFactory.getInstance( MBMessage.class.getName(), renderRequest); MBMessageLocalServiceUtil.addMessage( _theme.getUserId(), _theme.getUser().getFullName(), _theme.getScopeGroupId(), MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, "TEST Message", "My Simple Message", files, false, MBThreadConstants.PRIORITY_NOT_GIVEN, true, serviceContext);}catch (SystemException ex) { ...}----------------------------------------Furthermore, there is no need to initialize the services as these are singletons that are ready for use. Just invoke their static methods.Also, use the factory add/delete/update methods from core services unless you are ABSOLUTELY sure what you are doing. 请登录以投票。 以……回复 取消 Ruben Gerad Mathew Ray Augé 13 年之前 Thank you Ray, I really appreciate your immediate assistance. I hope I can document my full development approach soon. 请登录以投票。 以……回复 取消 Kevin Jebel Ruben Gerad Mathew 13 年之前 Hello,Can anyone tell me how to get user attributes from a vaadin portlet please ? 请登录以投票。 以……回复 取消 Ray Augé Kevin Jebel 13 年之前 - 编辑过的 There should be no difference with Vaadin, provided you can get a handle on the underlying portletRequest/Response objects so that you can interact with the JSR-168/286 API. 请登录以投票。 以……回复 取消
Ray Augé Ruben Gerad Mathew 13 年之前 Not sure why you have to get the RenderRequest from the already obtained PortletRequest (should both the be the same objects), but perhaps this is a quirck with faces I'm not aware of...Otherwise try this:----------------------------------------try{ RenderRequest renderRequest = ... ThemeDisplay _theme = (ThemeDisplay)renderRequest.getAttribute( WebKeys.THEME_DISPLAY); List<ObjectValuePair<String, byte[]>> files = Collections.EMPTY_LIST; ServiceContext serviceContext = ServiceContextFactory.getInstance( MBMessage.class.getName(), renderRequest); MBMessageLocalServiceUtil.addMessage( _theme.getUserId(), _theme.getUser().getFullName(), _theme.getScopeGroupId(), MBCategoryConstants.DEFAULT_PARENT_CATEGORY_ID, "TEST Message", "My Simple Message", files, false, MBThreadConstants.PRIORITY_NOT_GIVEN, true, serviceContext);}catch (SystemException ex) { ...}----------------------------------------Furthermore, there is no need to initialize the services as these are singletons that are ready for use. Just invoke their static methods.Also, use the factory add/delete/update methods from core services unless you are ABSOLUTELY sure what you are doing. 请登录以投票。 以……回复 取消 Ruben Gerad Mathew Ray Augé 13 年之前 Thank you Ray, I really appreciate your immediate assistance. I hope I can document my full development approach soon. 请登录以投票。 以……回复 取消 Kevin Jebel Ruben Gerad Mathew 13 年之前 Hello,Can anyone tell me how to get user attributes from a vaadin portlet please ? 请登录以投票。 以……回复 取消 Ray Augé Kevin Jebel 13 年之前 - 编辑过的 There should be no difference with Vaadin, provided you can get a handle on the underlying portletRequest/Response objects so that you can interact with the JSR-168/286 API. 请登录以投票。 以……回复 取消
Ruben Gerad Mathew Ray Augé 13 年之前 Thank you Ray, I really appreciate your immediate assistance. I hope I can document my full development approach soon. 请登录以投票。 以……回复 取消 Kevin Jebel Ruben Gerad Mathew 13 年之前 Hello,Can anyone tell me how to get user attributes from a vaadin portlet please ? 请登录以投票。 以……回复 取消 Ray Augé Kevin Jebel 13 年之前 - 编辑过的 There should be no difference with Vaadin, provided you can get a handle on the underlying portletRequest/Response objects so that you can interact with the JSR-168/286 API. 请登录以投票。 以……回复 取消
Kevin Jebel Ruben Gerad Mathew 13 年之前 Hello,Can anyone tell me how to get user attributes from a vaadin portlet please ? 请登录以投票。 以……回复 取消 Ray Augé Kevin Jebel 13 年之前 - 编辑过的 There should be no difference with Vaadin, provided you can get a handle on the underlying portletRequest/Response objects so that you can interact with the JSR-168/286 API. 请登录以投票。 以……回复 取消
Ray Augé Kevin Jebel 13 年之前 - 编辑过的 There should be no difference with Vaadin, provided you can get a handle on the underlying portletRequest/Response objects so that you can interact with the JSR-168/286 API. 请登录以投票。 以……回复 取消
Mark Ricard 13 年之前 Very nice article. Do you know how to also get at the "custom fields" values for a particular object? I added a custom field for the Organization type but cannot seem to get the values that are at a particular object. I posted the question in the forum. Not sure if you knew. (http://www.liferay.com/community/forums/-/message_boards/message/5857914?_19_preview=false) 请登录以投票。 以……回复 取消 Ray Augé Mark Ricard 13 年之前 Mark, I responded to the post directly. 请登录以投票。 以……回复 取消
Philipp Bouillon 13 年之前 Thanks, but I am having trouble getting your example to work. Since I am completely new to Liferay, I am sure, my problem is an easy one, but googling didn't help.Here's what I did:Using the Eclipse Liferay IDE, I created a new Portlet. In the view.jsp, I have this code:<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %><%@ page import="javax.portlet.PortletRequest"%><%@ page import="java.util.Map"%><portlet:defineObjects /><%Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);String givenName = (userInfo != null) ? (String)userInfo.get("user.name.given") : "<empty>";String loginId = (userInfo != null) ? (String) userInfo.get("user.login.id") : "<empty>";String userPassword = PortalUtil.getUserPassword(request);%>Given Name: <%= givenName %>Login ID: <%= loginId %>Password: <%= userPassword %>After deployment, the page shows "Given Name: null, Login ID: null, Password: null", whether I am currently logged in or not. Is there anything I can do to solve this issue? What have I missed? Thanks! 请登录以投票。 以……回复 取消 Philipp Bouillon Philipp Bouillon 13 年之前 Arrgh! Ok, sorry: portlet-app. I see. I forgot to include them. Sorry!!However, the password still is not shown, because I couldn't add that one to the portlet-app tags. How do I make the password bit available? Thanks! 请登录以投票。 以……回复 取消
Philipp Bouillon Philipp Bouillon 13 年之前 Arrgh! Ok, sorry: portlet-app. I see. I forgot to include them. Sorry!!However, the password still is not shown, because I couldn't add that one to the portlet-app tags. How do I make the password bit available? Thanks! 请登录以投票。 以……回复 取消
Its Me 13 年之前 I'm using liferay 6. I would like to get current user attributes in the controller.my methods looks like this, and i'm not using annotation (instead of renderingRequests?)@RequestMapping(params = "action=myMethod") public String myMethod(ModelMap model) throws Exception { // Here I want to get current name and save something with his/her name to the database (over a service) model.put("done", isSuccessfull); return "finished"; } 请登录以投票。 以……回复 取消 Its Me Its Me 13 年之前 how can i do this here, to get some name of current logged in person? 请登录以投票。 以……回复 取消 Its Me Its Me 13 年之前 Okay, not very compicated. Described as aboth. But i will give some more explicite examplego to YourController.javaI) Portlet.xmlDo as described above in main post under "Personalizaton via Portlet spec(s)"II) Controller.java1) Define----------------------------------------------------------------public class YourController.java[...]@Inject // I'm not sure if i have to inject this, but i did.protected PortletRequest portRequest; protected Map mapReq;[...]2) Code request in your method----------------------------@RequestMapping(params = "action=yourMethod")public String pushIt(ModelMap model) throws Exception { Map userInfo =(Map)portRequest.getAttribute(PortletRequest.USER_INFO); String givenName = (userInfo != null) ? (String)userInfo.get("user.name.given") : ""; model.put("getQuickMessages", countNewMessages()); return "thanx";} 请登录以投票。 以……回复 取消
Its Me Its Me 13 年之前 how can i do this here, to get some name of current logged in person? 请登录以投票。 以……回复 取消 Its Me Its Me 13 年之前 Okay, not very compicated. Described as aboth. But i will give some more explicite examplego to YourController.javaI) Portlet.xmlDo as described above in main post under "Personalizaton via Portlet spec(s)"II) Controller.java1) Define----------------------------------------------------------------public class YourController.java[...]@Inject // I'm not sure if i have to inject this, but i did.protected PortletRequest portRequest; protected Map mapReq;[...]2) Code request in your method----------------------------@RequestMapping(params = "action=yourMethod")public String pushIt(ModelMap model) throws Exception { Map userInfo =(Map)portRequest.getAttribute(PortletRequest.USER_INFO); String givenName = (userInfo != null) ? (String)userInfo.get("user.name.given") : ""; model.put("getQuickMessages", countNewMessages()); return "thanx";} 请登录以投票。 以……回复 取消
Its Me Its Me 13 年之前 Okay, not very compicated. Described as aboth. But i will give some more explicite examplego to YourController.javaI) Portlet.xmlDo as described above in main post under "Personalizaton via Portlet spec(s)"II) Controller.java1) Define----------------------------------------------------------------public class YourController.java[...]@Inject // I'm not sure if i have to inject this, but i did.protected PortletRequest portRequest; protected Map mapReq;[...]2) Code request in your method----------------------------@RequestMapping(params = "action=yourMethod")public String pushIt(ModelMap model) throws Exception { Map userInfo =(Map)portRequest.getAttribute(PortletRequest.USER_INFO); String givenName = (userInfo != null) ? (String)userInfo.get("user.name.given") : ""; model.put("getQuickMessages", countNewMessages()); return "thanx";} 请登录以投票。 以……回复 取消
Abhay Doshi 13 年之前 Ray: I think I've followed your instructions to the dot. Here's my Portlet.xml --<?xml version="1.0"?><portlet-app version="2.0" xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"> <portlet> <portlet-name>my-email</portlet-name> <display-name>My Email</display-name> <portlet-class>com.liferay.util.bridges.mvc.MVCPortlet</portlet-class> <init-param> <name>view-jsp</name> <value>/view.jsp</value> </init-param> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> </supports> <portlet-info> <title>My Email</title> <short-title>My Email</short-title> <keywords>My Email</keywords> </portlet-info> <security-role-ref> <role-name>administrator</role-name> </security-role-ref> <security-role-ref> <role-name>guest</role-name> </security-role-ref> <security-role-ref> <role-name>power-user</role-name> </security-role-ref> <security-role-ref> <role-name>user</role-name> </security-role-ref> </portlet> <user-attribute> <description>User Given Name</description> <name>user.name.given</name> </user-attribute> <user-attribute> <description>User Last Name</description> <name>user.name.family</name> </user-attribute> <user-attribute> <description>User eMail</description> <name>user.home-info.online.email</name> </user-attribute> </portlet-app>And the code snippet I am using to read the User's email :<portlet:defineObjects /><% Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO); String emailID = "init@notworking.com"; if(userInfo!=null){ emailID = (String) userInfo.get("user.home-info.online.email"); System.out.println("Email ID:"+ emailID); }I always get userInfo variable as a null Can you guide me ? 请登录以投票。 以……回复 取消 Ray Augé Abhay Doshi 13 年之前 It took me a few minutes to see the problem myself, but once you realize that "request" is not a PortletRequest it's quite obvious. You need to get the USER_INFO from a PortletRequest, in this case it would be from the "RenderRequest" which is automatically added to the page scope by <portlet:defineObjects />.So change the line to:Map userInfo = (Map) renderRequest.getAttribute(PortletRequest.USER_INFO);and it will work. 请登录以投票。 以……回复 取消 Abhay Doshi Ray Augé 13 年之前 Sir, you are awesome ! Thank you 请登录以投票。 以……回复 取消 Ray Augé Abhay Doshi 13 年之前 Thank you! I'm glad to help. 请登录以投票。 以……回复 取消 Abhay Doshi Ray Augé 13 年之前 Quick question: How can I access the user's additional email address (under profile) and custom fields ? 请登录以投票。 以……回复 取消 prabhakar m Abhay Doshi 13 年之前 hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte 请登录以投票。 以……回复 取消 Ray Augé prabhakar m 13 年之前 You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes sir im accessing through the portal only.. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 im getting error in the portlet itself. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? 请登录以投票。 以……回复 取消
Ray Augé Abhay Doshi 13 年之前 It took me a few minutes to see the problem myself, but once you realize that "request" is not a PortletRequest it's quite obvious. You need to get the USER_INFO from a PortletRequest, in this case it would be from the "RenderRequest" which is automatically added to the page scope by <portlet:defineObjects />.So change the line to:Map userInfo = (Map) renderRequest.getAttribute(PortletRequest.USER_INFO);and it will work. 请登录以投票。 以……回复 取消 Abhay Doshi Ray Augé 13 年之前 Sir, you are awesome ! Thank you 请登录以投票。 以……回复 取消 Ray Augé Abhay Doshi 13 年之前 Thank you! I'm glad to help. 请登录以投票。 以……回复 取消 Abhay Doshi Ray Augé 13 年之前 Quick question: How can I access the user's additional email address (under profile) and custom fields ? 请登录以投票。 以……回复 取消 prabhakar m Abhay Doshi 13 年之前 hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte 请登录以投票。 以……回复 取消 Ray Augé prabhakar m 13 年之前 You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes sir im accessing through the portal only.. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 im getting error in the portlet itself. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? 请登录以投票。 以……回复 取消
Abhay Doshi Ray Augé 13 年之前 Sir, you are awesome ! Thank you 请登录以投票。 以……回复 取消 Ray Augé Abhay Doshi 13 年之前 Thank you! I'm glad to help. 请登录以投票。 以……回复 取消 Abhay Doshi Ray Augé 13 年之前 Quick question: How can I access the user's additional email address (under profile) and custom fields ? 请登录以投票。 以……回复 取消 prabhakar m Abhay Doshi 13 年之前 hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte 请登录以投票。 以……回复 取消 Ray Augé prabhakar m 13 年之前 You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes sir im accessing through the portal only.. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 im getting error in the portlet itself. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? 请登录以投票。 以……回复 取消
Ray Augé Abhay Doshi 13 年之前 Thank you! I'm glad to help. 请登录以投票。 以……回复 取消 Abhay Doshi Ray Augé 13 年之前 Quick question: How can I access the user's additional email address (under profile) and custom fields ? 请登录以投票。 以……回复 取消 prabhakar m Abhay Doshi 13 年之前 hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte 请登录以投票。 以……回复 取消 Ray Augé prabhakar m 13 年之前 You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes sir im accessing through the portal only.. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 im getting error in the portlet itself. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? 请登录以投票。 以……回复 取消
Abhay Doshi Ray Augé 13 年之前 Quick question: How can I access the user's additional email address (under profile) and custom fields ? 请登录以投票。 以……回复 取消 prabhakar m Abhay Doshi 13 年之前 hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte 请登录以投票。 以……回复 取消 Ray Augé prabhakar m 13 年之前 You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes sir im accessing through the portal only.. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 im getting error in the portlet itself. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? 请登录以投票。 以……回复 取消
prabhakar m Abhay Doshi 13 年之前 hello ray... i got dis error while runnig my jsporg.apache.jasper.JasperException: An exception occurred processing JSP page /user.jsp at line 85: 6: <portlet:defineObjects />7: <%8: Map userInfo = (Map)renderRequest.getAttribute(PortletRequest.USER_INFO);9: String emailID = "init@notworking.com";10: if(userInfo!=null){11: emailID = (String) userInfo.get("user.home-info.online.email");Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:126) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:126) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:123) com.liferay.portal.kernel.servlet.PortalClassLoaderFilter.doFilter(PortalClassLoaderFilter.java:53) com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:196) com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilte 请登录以投票。 以……回复 取消 Ray Augé prabhakar m 13 年之前 You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes sir im accessing through the portal only.. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 im getting error in the portlet itself. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? 请登录以投票。 以……回复 取消
Ray Augé prabhakar m 13 年之前 You aren't accessing the jsp through a portlet, so it won't work. You can't arbitrarily hit a jsp in a portlet and have it work as if through the portal. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes sir im accessing through the portal only.. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 im getting error in the portlet itself. 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks 请登录以投票。 以……回复 取消 prabhakar m Ray Augé 13 年之前 yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? 请登录以投票。 以……回复 取消
prabhakar m Ray Augé 13 年之前 yes sir im accessing through the portal only.. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 im getting error in the portlet itself. 请登录以投票。 以……回复 取消
prabhakar m Ray Augé 13 年之前 And the code snippet I am using to read the User's email :<portlet:defineObjects /><%Map userInfo = (Map) request.getAttribute(PortletRequest.USER_INFO);String emailID = "init@notworking.com";if(userInfo!=null){emailID = (String) userInfo.get("user.home-info.online.email");System.out.println("Email ID:"+ emailID);}%><%=emailID%> with this code(with out render ) im getting "init@notworking.com" if i use renderRequest... im getting apache error.. plz guide me. 请登录以投票。 以……回复 取消 prabhakar m prabhakar m 13 年之前 i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz 请登录以投票。 以……回复 取消
prabhakar m prabhakar m 13 年之前 i want to dispaly the current user id who is accessing the portlet in liferay 6.0.5. ..this is my requirement.. i created a simple jsp portlet.. and installd it in to liferay portal.. help me plz 请登录以投票。 以……回复 取消
prabhakar m Ray Augé 13 年之前 mr.ray thanks for such a useful blog.. i hope i ll get solution here...thanks 请登录以投票。 以……回复 取消
prabhakar m Ray Augé 13 年之前 yes mr. ray i got user id and email... itz only show ing in view.jsp... links are not woking in dat page..but i want to get user id in my index page is it possible? because i need to save the email in to mysql database.. is it possible? 请登录以投票。 以……回复 取消