Saturday, November 18, 2017

Firefox 57 and Tree Style Tabs BROKEN

It's amazing how much damage the new version of Firefox is inflicting to the user community.

If you are a Tree Style Tab user and HATE seeing the tabs being displayed on top and left at same time:

In a nutshell (on Windows)

open a cmd prompt
cd Mozilla/Firefox/Profiles/
cd *** (whatever is named your profile.... no clue why they could not choose a fixed name...)
mkdir chrome

in this chrome folder, create a userChrome.css file with this content:

@namespace url("");

/* to hide the native tabs */
#TabsToolbar {
    visibility: collapse;

/* to hide the sidebar header */
#sidebar-header {
    visibility: collapse;

and restart Firefox.... and pray that with next release they will not break everything again.

For the time being I have disabled the automatic update of Firefox...

Friday, November 17, 2017

JSF crash course

Home page , particularly this introduction

Decent introduction (a bit too verbose, skip the central videos on how to install sw).

The helloworld code is here



Great collection of books on JSF (mostly very ancient)

Remote debug Wildfly with Eclipse, KeycloakPrincipal

./standalone.bat --debug

This generates

JAVA_OPTS: " -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djboss.modules.system.pkgs=org.jboss.byteman -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n"


Listening for transport dt_socket at address: 8787

In fact, in standalone.bat you find this code:

rem Set debug settings if not already set
if "%DEBUG_MODE%" == "true" (
   echo "%JAVA_OPTS%" | findstr /I "\-agentlib:jdwp" > nul
  if errorlevel == 1 (
     set "JAVA_OPTS=%JAVA_OPTS% -agentlib:jdwp=transport=dt_socket,address=%DEBUG_PORT_VAR%,server=y,suspend=n"
  ) else (
     echo Debug already enabled in JAVA_OPTS, ignoring --debug argument

You can now follow these instructions to configure Eclipse,
or simply

right-click on project in eclipse, Debug as, Remote Java Application, then you get this dialog

so I can trace this code:

public String getPrincipalName(HttpServletRequest request) {
KeycloakPrincipal keycloakPrincipal = (KeycloakPrincipal)request.getUserPrincipal();
return keycloakPrincipal != null ? keycloakPrincipal.getKeycloakSecurityContext().toString() : "unauthenticated" ;

and discover this:

In a ManagedBean you can inject a Principal, and Wildfly will take care of it transparently:

public class EventViewBean {
@Inject Principal principal;

public void getPrincipal() {
System.out.println("principal class name is " + principal.getClass().gtName());

This will print a:$$Proxy$_$$_Weld$Proxy$

and not - as expected - a who however also implements the interface