Posts

How to redirect or forward request in Hybris?

What is basic difference between request Redirect Vs Forward? Redirect:  Server sends a header (in response) back to the browser/client, which contain redirect URL, then browser initiates a new request to redirect URL. Browser creates a new request to the redirected URL. The browser displays the redirected URL. The client browser is involved. Redirect is slower. When can we use Redirect? @RequestMapping(value = "/originalurl", method = {RequestMethod.POST}) public String method(final Model model) { // ... return "redirect:/redirectToGeturl"; } Usually, when data is posted to the server, we should redirect to get method(URL). So browser displays redirected URL(/redirectToGeturl). Which also prevent data resubmission on browser refreshed(F5) as the request to will go to redirected URL(/redirectToGeturl). Forward:  Within the server, control can be forwarded to target resource(URL). Which is done by container internally so browser/clie

How to add you custom class in HAC logging list?

Scenario Hybris use  log4j2 logger . We can change the log level for preconfigured classes from the HAC > Platform > Loggin (like root , org.springframework etc.). But what if we want to configure logger for our custom class. Solution Add logger statement in your java class add log4j2 configuration for your custom Java class Restart the Hybris server MyService.Java private static final Logger LOG = Logger.getLogger(MyService.class); LOG.debug("I am debug log"); local.properties \#log4j2 configuration log4j2.rootLogger.level = warn log4j2.logger.myService.name = com.extended.service.impl.MyService log4j2.logger.myService.level = warn log4j2.logger.myService.appenderRef.stdout.ref = STDOUT log4j2.logger.customService.name = com.extended.service.impl.CustomService log4j2.logger.customService.level = warn log4j2.logger.customService.appenderRef.stdout.ref = STDOUT Do you know this also can be done  without restarting Hybris server?

How to Integrate Google Enhanced Ecommerce with Hybris

How to implement Universal Analytics (UA) Enhanced Ecommerce features using Google Tag Manager on a Hybris? We already have successfully implemented Enhanced E-commerce (Integrating Google Analytics) for many of Hybris sites. This will be paid service. contact@helphybris.com

Hybris ERR_TOO_MANY_REDIRECTS with Apache AJP proxy?

Problem statement: We have setup Apache as the reverse proxy using  mod_proxy_ajp . When we access any Product or Category having "+" in their name, we get  ERR_TOO_MANY_REDIRECTS  error. Solution: The way Apache handles "+", causes a redirection loop. You can add "nocanon" to your ajp directives to resolve this. Now you are free to use "+" character in the product name. ... <VirtualHost *:443> ... ProxyPass / ajp://localhost:8009/ nocanon </VirtualHost> ...  Allow slash [will not work with Hybris] If you also want to allow slash "\", then you should configure the proxy server to pass the request URL with no decoded for it. check the below configuration using  AllowEncodedSlashes NoDecode <VirtualHost *:443> ... AllowEncodedSlashes NoDecode ProxyPass / ajp://localhost:8009/ nocanon </VirtualHost> ProxyPass Keywords  nocano