question: public static void rewriteMenuURL ( ArrayList < MWebMenu > menuList , HttpServletRequest request ) { HttpSession session = request . getSession ( ) ; String sessionID = session . getId ( ) ; for ( MWebMenu menu : menuList ) { String link = menu . getMenuLink ( ) ; int index = link . indexOf ( "?" ) ; if ( index != - 1 ) { String part1 = link . substring ( 0 , index ) ; String part2 = link . substring ( index ) ; link = part1 + ";jsessionid=" + sessionID + part2 ; menu . setMenuLink ( link ) ; } } }
target:  Rewrite all the URLs. Adds session id if not present