Posts

Compatibility between JDK and AWS

Have been spending 2 week to figure out the bug "Could not initialize class com.amazonaws.http.AmazonHttpClient" Considering all the matching source code, I suppose JDK is the highly probable cause for this error. Will check tmr. Annoying... https://github.com/aws/aws-sdk-java/issues/1757 https://web.liferay.com/services/support/compatibility-matrix

Interface

Does anyone here know how a soda machine works? (Cue confused glances about why we'd even talk about this.) No? Let me tell you. You drop in your change, and inside the machine is a little monkey who counts all your change to make sure you put in enough money. When you press the button for your soda, a little light comes on telling the monkey which button you pressed, and if you entered the right amount of change, he grabs your choice and throws it into the little hole for you to grab your soda. This is the concept of encapsulation. We hide the implementation of the soda machine. Unless it's got one of those fancy, clear windows to let you see the inside, you honestly have no idea how it really works. All you know is that you put in some cash, you press a button, and if you put in enough, you get your drink. To add to that, you know how to use a soda machine's  interface , so therefore as long as the machine's  interface  follows the usual soda machine interface,...

Adding portlet to control panel

Getting the crrent portlet Id can be done through themeDisplay. ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest .getAttribute(WebKeys.THEME_DISPLAY); If you want to retrieve portlet Id in View, this is the typical way to do it. However, when you are in Portlet class (java), you can directly get it through request using some Util class (ex PortletUtil... not this one tho) I could not find the appropriate util, so I am gonna just apply the themeDisplay way. found it PortalUtil.getPortletId(HttpServletRequest request)
Prevent users with unverified email address from logging in (not able to sign in with unverified email ) 1. modify the return value of loadUserByUsername() in UserServiceImpl 2. Create a new user and try to sign in without Email verification step Add code to send email 1. Create AmazonSES under shared package -check contact path in properties file for verification link 2. add code to CreateUser in UserServiceimpl 3. test Creating user (with the verified email if you have not moved out of aws sandbox.) internet needed. 4. check email Reset Password 1. requestReset in User controller 2. create  PasswordResetRequestModel in Request package 3. add resetPassword to RequestOperationName 4. implement resetPassword logic in service layer 5. implement generatePasswordResetToken in Utils Creaet PasswordResetTokenEntity & Password Reset Repo 1.

elaelaela

Image

How to use expando attribute for tracking user activation

Image

Top Java App Server - Servlet Container

https://stackify.com/tomcat-vs-jetty-vs-glassfish-vs-wildfly/ Tomcat Server is a servlet container What is a Servlet? A Servlet is a java object from a class which extends from javax.servlet.http.HttpServlet. This is not exactly true because there is different types of Servlets but HttpServlet is clearly the most used. What is a Servlet Container? A Servlet Container is a program which can receive requests from web pages and redirect those requests to a Servlet object. How does this Servlet Container work? The Browser asks the HTTP server for a page, which is a Servlet Container. The Servlet Container delegates the request to a particular Servlet chosen between the Servlets it contains. The Servlet, which is a java object, is in charge of generating the text of the web page delivered to the container. The container returns the web page to the Browser which made the request.