2 Replies Latest reply on Feb 11, 2015 9:16 AM by sachin singh

    javax.enterprise.resource.webcontainer.jsf.application (default task-10) Error Rendering View[/user/profile.xhtml]: java.lang.NullPointerException at java.net.URLEncoder.encode(URLEncoder.java:205) [rt.jar:1.7.0]

    sachin singh Newbie

      Hi guys,

      I'm facing some stragne problem . when I'm commenting below bold red color code it's working from me and if deleting or not commenting it's showing error mension below.

      I tried clean project and try to run war file outside of eclpise it's not working for me. please help

       

       

      Error getting while sign-in

       

      19:36:42,668 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990

      19:36:42,669 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.0.0.Final "WildFly" started in 16804ms - Started 391 of 443 services (91 services are lazy, passive or on-demand)

      19:37:21,052 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (default task-10) Error Rendering View[/user/profile.xhtml]: java.lang.NullPointerException

              at java.net.URLEncoder.encode(URLEncoder.java:205) [rt.jar:1.7.0]

              at com.sun.faces.context.UrlBuilder.addValuesToParameter(UrlBuilder.java:318) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.context.UrlBuilder.addParameters(UrlBuilder.java:127) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.context.ExternalContextImpl.encodeBookmarkableURL(ExternalContextImpl.java:1045) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.application.view.MultiViewHandler.getBookmarkableURL(MultiViewHandler.java:407) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at org.jboss.weld.jsf.ConversationAwareViewHandler.getBookmarkableURL(ConversationAwareViewHandler.java:132) [weld-core-jsf-2.1.2.Final.jar:2014-01-09 09:23]

              at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at com.sun.faces.renderkit.html_basic.OutcomeTargetRenderer.getEncodedTargetURL(OutcomeTargetRenderer.java:194) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.renderkit.html_basic.OutcomeTargetLinkRenderer.renderAsActive(OutcomeTargetLinkRenderer.java:158) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.renderkit.html_basic.OutcomeTargetLinkRenderer.encodeBegin(OutcomeTargetLinkRenderer.java:96) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:864) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at com.sun.faces.facelets.component.RepeatRenderer.encodeChildren(RepeatRenderer.java:104) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:621) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:1105) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]

       

      19:37:21,075 ERROR [io.undertow.request] (default task-10) UT005023: Exception handling request to /user/profile.jsf: javax.servlet.ServletException

              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687) [undertow-core-1.0.0.Final.jar:1.0.0.Final]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]

      Caused by: java.lang.NullPointerException

              at java.net.URLEncoder.encode(URLEncoder.java:205) [rt.jar:1.7.0]

              at com.sun.faces.context.UrlBuilder.addValuesToParameter(UrlBuilder.java:318) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.context.UrlBuilder.addParameters(UrlBuilder.java:127) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.context.ExternalContextImpl.encodeBookmarkableURL(ExternalContextImpl.java:1045) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.application.view.MultiViewHandler.getBookmarkableURL(MultiViewHandler.java:407) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at org.jboss.weld.jsf.ConversationAwareViewHandler.getBookmarkableURL(ConversationAwareViewHandler.java:132) [weld-core-jsf-2.1.2.Final.jar:2014-01-09 09:23]

              at javax.faces.application.ViewHandlerWrapper.getBookmarkableURL(ViewHandlerWrapper.java:272) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at com.sun.faces.renderkit.html_basic.OutcomeTargetRenderer.getEncodedTargetURL(OutcomeTargetRenderer.java:194) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.renderkit.html_basic.OutcomeTargetLinkRenderer.renderAsActive(OutcomeTargetLinkRenderer.java:158) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.renderkit.html_basic.OutcomeTargetLinkRenderer.encodeBegin(OutcomeTargetLinkRenderer.java:96) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:864) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at com.sun.faces.facelets.component.RepeatRenderer.encodeChildren(RepeatRenderer.java:104) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.facelets.component.UIRepeat.process(UIRepeat.java:621) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.facelets.component.UIRepeat.encodeChildren(UIRepeat.java:1105) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) [jsf-impl-2.2.5-jbossorg-3.jar:]

              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) [jboss-jsf-api_2.2_spec-2.2.5.jar:2.2.5]

              ... 26 more

      -----------------------------------------------------------------------------------------------------------------------------------------------------

      Here is my profile.xtml -

       

      <!DOCTYPE html [

          <!ENTITY raquo "&#187;">

      ]>

       

      <html xmlns="http://www.w3.org/1999/xhtml"

          xmlns:f="http://java.sun.com/jsf/core"

          xmlns:ui="http://java.sun.com/jsf/facelets"

          xmlns:h="http://java.sun.com/jsf/html"

          xmlns:sky="http://skylarksystems.com/jsf/components">

       

      <f:metadata>

          <f:viewParam name="id" value="#{profileBean.employer.id}"/>

      </f:metadata>

       

      <ui:composition template="/WEB-INF/templates/employee.xhtml">

          <ui:define name="PageTitle">IndustryHunt - #{profileBean.user.name}</ui:define>

         

          <ui:define name="SidebarContent">

          <h:outputScript target="head">

              $(document).ready(function() {

                  if(window.isMobile) {

                      $('.profimg').width(80);

                      $('.span4').width(80);

                      $('.span4').css({'float': 'left', 'margin-right': '4px', 'margin-bottom': '4px'});

                  }

                  if(#{empty profileBean.user}) {

                      $('#SideLinks').hide();

                  }

              });

             

              $('#AdminBox').hide();

              var adminshow = false;

       

              function toggleAdmins() {

                  if(adminshow) {

                      $('#AdminBox').hide();

                      adminshow = false;

                  }

                  else {

                      $('#AdminBox').show();

                      adminshow = true;

                  }

              }

          </h:outputScript>

              <ui:fragment rendered="#{not profileBean.me and userBean.loggedIn}">

                  <h:form>

                      <ui:fragment rendered="#{profileBean.connected}">

                          You are connected to #{profileBean.user.name}

                          <h:commandButton value="Disconnect" action="#{profileBean.disconnect}" styleClass="btn"/>

                      </ui:fragment>

                      <ui:fragment rendered="#{not profileBean.connected}">

                          Connect to #{profileBean.user.name} to get updates and stay in touch

                          <h:commandButton value="Connect" action="#{profileBean.connect}" styleClass="btn"/>

                      </ui:fragment>

                  </h:form>

              </ui:fragment>

              <ui:fragment rendered="#{not empty profileBean.user}">

              <div class="row-fluid" id="connections-box">

              <div class="span12">

                  <h:link outcome="/user/connections">

                      <f:param name="id" value="#{profileBean.user.id}"/>

                      <b>Connections <span class="badge">#{profileBean.connections.size()}</span></b>

                  </h:link>

                  <ul style="margin-top: 10px;">

                         <ui:repeat var="uc" value="#{profileBean.connections.subList(0, (profileBean.connections.size() gt 6)?6:profileBean.connections.size())}" >

                          <ui:fragment rendered="#{not profileBean.isHiddenTo(uc.getTargetUser()) or userBean.matchesId(uc.targetUser) or profileBean.me}">

                              <li class="span4">

                                  <h:link outcome="/user/profile" class="thumbnail">

                                      <f:param name="id" value="#{uc.targetUser}"/>

                                      <ui:fragment rendered="#{not empty profileBean.getProfilePictureById(uc.targetUser)}">

                                          <img class="connection-img profimg" src="../rest/fileservice/thumbbyid/#{uc.targetUser}/#{profileBean.getProfilePictureById(uc.targetUser)}" width="80"/>

                                      </ui:fragment>

                                      <ui:fragment rendered="#{empty profileBean.getProfilePictureById(uc.targetUser)}">

                                          <img class="profimg" src="#{request.contextPath}/img/GreyAvatar80x80.jpg" height="80" width="80"/>

                                      </ui:fragment>

                                  </h:link>

                                  <div class="connection-name">

                                      <h:link outcome="/user/profile">

                                          <f:param name="id" value="#{uc.targetUser}"/>

                                          #{profileBean.getUserNameById(uc.targetUser)}

                                      </h:link>

                                  </div>

                              </li>

                          </ui:fragment>

                         </ui:repeat>

                  </ul>

              </div>

              </div>

              <ui:fragment rendered="#{profileBean.me and userBean.employer}">

              <div class="row-fluid" id="admins-box">

              <div class="span12">

                  <h:link outcome="/user/admins">

                      <b>Admins <span class="badge">#{profileBean.employerAdmin.size()}</span> <a href="javascript:toggleAdmins();"><img src="/img/arrow-down.png"/></a></b>

                  </h:link>

                  <ul id="AdminBox" style="display: none; margin-top: 10px;">

                      <ui:repeat var="ad" value="#{profileBean.employerAdmin}">

                          <li class="span4">

                              <h:link outcome="/user/profile" class="thumbnail">

                                  <f:param name="id" value="#{ad.adminUser.id}"/>

                                  <ui:fragment rendered="#{not empty profileBean.getProfilePictureById(ad.adminUser.id)}">

                                      <img class="connection-img profimg" src="../rest/fileservice/thumbbyid/#{ad.adminUser.id}/#{profileBean.getProfilePictureById(ad.adminUser.id)}" width="80"/>

                                  </ui:fragment>

                                  <ui:fragment rendered="#{empty profileBean.getProfilePictureById(ad.adminUser.id)}">

                                      <img class="profimg" src="#{request.contextPath}/img/GreyAvatar80x80.jpg" height="80" width="80"/>

                                  </ui:fragment>

                              </h:link>

                              <div class="connection-name">

                                  <h:link outcome="/user/profile">

                                      <f:param name="id" value="#{ad.adminUser.id}"/>

                                      #{profileBean.getUserNameById(ad.adminUser.id)}

                                  </h:link>

                              </div>

                          </li>

                      </ui:repeat>

                  </ul>

              </div>

              </div>

              </ui:fragment>

              </ui:fragment>

          </ui:define>

         

          <ui:define name="EmployeeContent">

              <h:outputStylesheet library="css" name="profile.css" target="head"/>

             

              <h:messages/>

             

              <ui:fragment rendered="#{empty profileBean.user}">

                  <p><h:link outcome="/signin">Sign in</h:link> to view your profile.</p>

                  <p>Don't have a profile yet? Click <h:link outcome="/signup">here</h:link> to sign up!</p>

       

              </ui:fragment>

              <ui:fragment rendered="#{not empty userBean.user and empty profileBean.employee and empty profileBean.employer and profileBean.me}">

                  <h:form id="ProfilePage">

                      <div class="row-fluid">

                          <h1>Choose profile type</h1>

                          <p>Please choose the profile type you want to use for this account.</p>

                          <h:commandButton action="#{profileBean.chooseEmployer}" styleClass="btn" value="Employer x"/>

                          <h:commandButton action="#{profileBean.chooseEmployee}" styleClass="btn" value="Employee x"/>

                      </div>

                  </h:form>

              </ui:fragment>

              <ui:fragment rendered="#{not empty profileBean.employee}">

                  <ui:include src="employee.xhtml"/>

              </ui:fragment>

              <ui:fragment rendered="#{not empty profileBean.employer}">

                  <h:outputStylesheet library="css" name="profile.css" target="head"/>

                  <ui:include src="employer.xhtml"/>

              </ui:fragment>

          </ui:define>

      </ui:composition>

       

      </html>

      -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      Here is my employer.xhtml

       

      <!DOCTYPE html [

          <!ENTITY raquo "&#187;">

      ]>

       

      <ui:composition xmlns="http://www.w3.org/1999/xhtml"

          xmlns:f="http://java.sun.com/jsf/core"

          xmlns:ui="http://java.sun.com/jsf/facelets"

          xmlns:h="http://java.sun.com/jsf/html">

       

          <h:outputStylesheet target="head">

              #custom-tweet-button {

                  display: inline-block;

              }

             

              .deal-tweet {

                  margin-top: -4px;

                  margin-right: 2px;

                  float: left;

              }

             

              .fb_iframe_widget > span {

                  padding-bottom: 5px;

              }

       

              .DealBox, .DealBox2 {

                  min-height: 175px;

                  margin-bottom: 10px;

              }

             

              .calenderbar {

                  border-bottom: 1px solid #ccc;

              }

       

              .calenderbar #bar {

                  margin-right: auto;

                  margin-left: auto;

                  width: 520px;

              }

       

              .calenderbar #bar li {

                  display: inline-block;

                  overflow: hidden;

                  list-style-type: none;

                  padding-right: 5px;

                 

                  height: 50px;

                  width: 50px;

                 

                  color: white;

                  background-color: #ccc;

              }

             

              .calenderbar #bar .active {

                  background-color: #0088cc;

              }

             

              .calenderbar #bar .left-arrow-disabled {

                  background-image: url('/img/arrow-left-disabled.png');

                  background-size: 25px 25px;

                  background-color: inherit;

                  background-repeat: no-repeat;

                  background-position: center;

              }

       

              .calenderbar #bar .left-arrow-enabled {

                  background-image: url('/img/arrow-left-enabled.png');

                  background-size: 25px 25px;

                  background-color: inherit;

                  background-repeat: no-repeat;

                  background-position: center;

              }

             

              .calenderbar #bar .right-arrow-enabled {

                  background-image: url('/img/arrow-right-enabled.png');

                  background-size: 25px 25px;

                  background-color: inherit;

                  background-repeat: no-repeat;

                  background-position: center;

              }

             

              .settings { margin-top: -40px; }

          </h:outputStylesheet>

          <h:outputScript target="body">

              (function(d, s, id) {

                  var js, fjs = d.getElementsByTagName(s)[0];

                  if (d.getElementById(id)) return;

                  js = d.createElement(s); js.id = id;

                  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&amp;version=v2.0";

                  fjs.parentNode.insertBefore(js, fjs);

              }(document, 'script', 'facebook-jssdk'));

              !function(d,s,id){

                  var js, fjs = d.getElementsByTagName(s)[0];

                  if(!d.getElementById(id)) {

                      js = d.createElement(s);

                      js.id = id;

                      js.src = "https://platform.twitter.com/widgets.js";

                      fjs.parentNode.insertBefore(js,fjs);

                  }

              }(document,"script","twitter-wjs");

              $("#deals").hide();

       

              if(!window.isMobile) {

                  $('#mobile-deals-hide').hide();

                  $('#mobile-jobs-hide').hide();

              }

       

              $('#job-applicants').attr('original-title', $('#job-applicants_list').html());

              $('#job-applicants').tipsy({html: true, trigger: "manual"});

             

              var appshow = false;

             

              function toggleApplicants() {

                  if(appshow) {

                      $('#job-applicants').tipsy('hide');

                      appshow = false;

                  }

                  else {

                      $('#job-applicants').tipsy('show');

                      appshow = true;

                  }

              }

             

              if(getParameterByName('show') == '1') {

                  toggleJD();

              }

       

              startDate = getParameterByName('date');

       

              if(window.isMobile) {

                  $('.calenderbar').calenderbar({isMobile: true, date: startDate});

                  $('.calenderbar').children('#bar').width(275);

              } else

                  $('.calenderbar').calenderbar({date: startDate});

       

              var expiredshow = false;

       

              function toggleExpired() {

                  if(expiredshow) {

                      $('#ExpiredDeals').hide();

                      expiredshow = false;

                  }

                  else {

                      $('#ExpiredDeals').show();

                      expiredshow = true;

                  }

              }

          </h:outputScript>

       

          <div id="EmployeeProfile" class="vcard">

              <div class="row-fluid">

                  <div class="span3">

                      <div class="PictureOuter">

                          <div class="PictureInner" style="position: relative;">

                              <ui:fragment rendered="#{profileBean.canEditEmployer}">

                                  <div style="position: absolute; left: 5px; bottom: 5px;"><h:link outcome="uploadfile"><i class="icon-camera"></i></h:link></div>

                              </ui:fragment>

                              <ui:fragment rendered="#{not empty profileBean.user.profilePicture}">

                                  <img src="../rest/fileservice/thumbbyid/#{profileBean.user.id}/#{profileBean.user.profilePicture}" width="160"/>

                              </ui:fragment>

                              <ui:fragment rendered="#{empty profileBean.user.profilePicture}">

                                  <img src="#{request.contextPath}/img/GreyAvatar140x140.jpg" height="160" width="160"/>

                              </ui:fragment>

                          </div>

                      </div>

                  </div>

                  <div class="span9">

                      <h1 class="fn">

                          #{profileBean.user.name}

                          <h:panelGroup rendered="#{profileBean.canEditEmployer}" layout="block" styleClass="pull-right">

                              <small><h:link outcome="editemployer"><i class="icon-pencil"></i> edit</h:link></small>

                          </h:panelGroup>

                          <h:panelGroup rendered="#{adminBean.isAdmin(profileBean.user, userBean.user)}" layout="block" styleClass="pull-right">

                              <small><h:link outcome="admin"><f:param name="id" value="#{profileBean.user.id}"/><i class="icon-pencil"></i> edit</h:link></small>

                          </h:panelGroup>

                      </h1>

                      <h:link outcome="reviews">

                          <f:param name="id" value="#{profileBean.user.id}"/>

                          <div id="rating" style="margin-top: -10px;"><h:outputText style="font-weight: bold; color: #FF9900;" value="#{profileBean.user.rating}" /> </div>

                      </h:link>

                      <p>

                      <ui:fragment rendered="#{not empty profileBean.employer.addressLine1}">#{profileBean.employer.addressLine1}<br /></ui:fragment>

                      <ui:fragment rendered="#{not empty profileBean.employer.city}">#{profileBean.employer.city}</ui:fragment>

                      <ui:fragment rendered="#{not empty profileBean.employer.state}"> #{profileBean.employer.state}</ui:fragment>

                      <ui:fragment rendered="#{not empty profileBean.employer.city}"> #{profileBean.employer.postalCode}</ui:fragment>

                      <ui:fragment rendered="#{not empty profileBean.employer.city or not empty profileBean.employer.state or not empty profileBean.employer.addressLine1}"><br /></ui:fragment>

                      <ui:fragment rendered="#{not empty profileBean.employer.phoneNumber}">#{profileBean.employer.phoneNumber}<br /></ui:fragment>

                      <ui:fragment rendered="#{not empty profileBean.employer.email}"><a href="//#{profileBean.employer.email}" target="_blank">#{profileBean.employer.email}</a></ui:fragment></p>

                  </div>

               </div>

       

              <div class="row-fluid" style="margin-top: 30px;">

                  <p><h:outputText escape="false" value="#{profileBean.employer.description}"/></p>

              </div>

       

              <ui:fragment rendered="#{not profileBean.employer.hiring or profileBean.canEditEmployer}">

                  <div id="jobs">

                  <h2><i class="icon-bar-chart"></i> Jobs <a id="mobile-jobs-hide" href="javascript:$('#JobForm').toggle();"><img src="/img/arrow-down.png" /></a></h2>

                  <h:form id="JobForm">

                      <ui:fragment rendered="#{empty profileBean.employerJobs}">

                          <div class="JobBox">

                              <h3>

                                  Hiring soon!

                                  <div class="fb-share-button" data-href="http://industryhunt.com/user/profile.jsf?id=#{profileBean.user.id}" data-type="icon"></div>

                                  <div id="custom-tweet-button"><a href="https://twitter.com/share?url=http://industryhunt.com/user/profile.jsf?id=#{profileBean.user.id}" target="_blank"><img src="https://twitter.com/favicons/favicon.ico" width="14px" height="14px"/></a></div>

                              </h3>

                              <p>Connect to get updates!</p>

                          </div>

                      </ui:fragment>

                      <ui:repeat value="#{profileBean.employerJobs}" var="job">

                           <div class="JobBox"  style="position: relative;">

                              <h3><h:link outcome="job">

                                      <f:param name="job" value="#{job.id}"/>

                                      <f:param name="id" value="#{profileBean.user.id}"/>

                                      #{job.jobTitle}

                                  </h:link>

                                  <div class="fb-share-button" data-href="http://industryhunt.com/user/job.jsf?job=#{job.id}&amp;id=#{profileBean.user.id}" data-type="icon"></div>

                                  <div id="custom-tweet-button"><a href="https://twitter.com/share?url=http://industryhunt.com/user/job.jsf?job=#{job.id}%26id=#{profileBean.user.id}" target="_blank"><img src="https://twitter.com/favicons/favicon.ico" width="14px" height="14px"/></a></div>

                                   <h:panelGroup rendered="#{profileBean.canEditEmployer and not job.defaultJob}" layout="block" styleClass="pull-right">

                                       <div class="dropdown">

                                          <a data-toggle="dropdown" href="#"><img src="/img/arrow-down.png"/> <img src="/img/glyphicons-gears.png"/></a>

                                          <ul class="dropdown-menu pull-right" style="font-size: 8pt;" role="menu">

                                              <li><h:link outcome="editjob">

                                                  <i class="icon-fixed-width icon-pencil"></i> edit

                                                  <f:param name="job" value="#{job.id}"/>

                                              </h:link></li>

                                               <li><h:commandLink action="#{jobBean.delete(job)}">

                                                  <i class="icon-fixed-width icon-trash"></i> remove

                                              </h:commandLink></li>

                                          </ul>

                                      </div>

                                  </h:panelGroup>

                                  <h:panelGroup rendered="#{adminBean.isAdmin(profileBean.user, userBean.user) and not job.defaultJob}" layout="block" styleClass="pull-right">

                                      <div class="dropdown">

                                          <a data-toggle="dropdown" href="#"><img src="/img/arrow-down.png"/> <img src="/img/glyphicons-gears.png"/></a>

                                          <ul class="dropdown-menu pull-right" style="font-size: 8pt;" role="menu">

                                              <li><h:link outcome="admineditjob">

                                                  <i class="icon-fixed-width icon-pencil"></i> edit

                                                  <f:param name="job" value="#{job.id}"/>

                                                  <f:param name="id" value="#{profileBean.user.id}" />

                                              </h:link></li>

                                              <li><h:commandLink action="#{adminBean.deleteJob(profileBean.user, job)}">

                                                  <i class="icon-fixed-width icon-trash"></i> remove

                                              </h:commandLink></li>

                                          </ul>

                                      </div>

                                  </h:panelGroup>

                                  <h:panelGroup rendered="#{not userBean.loggedIn and not job.defaultJob}" layout="block" styleClass="pull-right">

                                      <small>

                                          <h:link outcome="/signup">

                                              Apply!

                                          </h:link>

                                      </small>

                                  </h:panelGroup>

                                  <h:panelGroup rendered="#{userBean.employee and not jobBean.isApplicant(job) and not profileBean.hiddenTo and not job.defaultJob}" layout="block" styleClass="pull-right">

                                      <small>

                                          <h:commandLink action="#{jobBean.applyTo(job, profileBean.user)}">

                                              Apply!

                                          </h:commandLink>

                                      </small>

                                  </h:panelGroup>

                                  <h:panelGroup rendered="#{userBean.employee and not jobBean.isApplicant(job) and profileBean.hiddenTo and not job.defaultJob}" layout="block" styleClass="pull-right">

                                      <small>

                                          <font original-title="Connect with this employer to apply">Apply!</font>

                                      </small>

                                  </h:panelGroup>

                                  <h:panelGroup rendered="#{userBean.employee and jobBean.isApplicant(job)}" layout="block" styleClass="pull-right">

                                      <small>

                                          <h:commandLink action="#{jobBean.unApplyTo(job, profileBean.user)}">

                                              Un-apply

                                          </h:commandLink>

                                      </small>

                                  </h:panelGroup>

                              </h3>

                              <p><h:outputText escape="false" value="#{job.jobDescription}"/></p>

                              <p><ui:fragment rendered="${not empty job.hourlyRateLow}">Hourly Rate: <b>$#{job.hourlyRateLow}</b> (Low) <b>$#{job.hourlyRateHigh}</b> (High) &#9642; </ui:fragment>

                              <ui:fragment rendered="#{not empty job.compensation}">Compensation: <b>#{job.compensation}</b> &#9642;</ui:fragment>

                              <ui:fragment rendered="#{not empty job.shiftTypeMorning or not empty job.shiftTypeAfternoon}">Shift:

                              <h:panelGroup rendered="#{job.shiftTypeMorning}"><b>Morning</b>, </h:panelGroup>

                              <h:panelGroup rendered="#{job.shiftTypeAfternoon}"><b>Afternoon</b>, </h:panelGroup>

                              <h:panelGroup rendered="#{job.shiftTypeNight}"><b>Night</b>, </h:panelGroup>

                              <h:panelGroup rendered="#{job.shiftTypeOvernight}"><b>Overnight</b></h:panelGroup> &#9642;

                              </ui:fragment>

                              Pay:

                              <h:panelGroup rendered="#{job.paidFullTime}"><b>full-time</b>, </h:panelGroup>

                              <h:panelGroup rendered="#{job.paidPartTime}"><b>part-time</b>, </h:panelGroup>

                              <h:panelGroup rendered="#{job.volunteerFullTime}"><b>Volunteer full-time</b>, </h:panelGroup>

                              <h:panelGroup rendered="#{job.volunteerPartTime}"><b>Volunteer part-time</b></h:panelGroup>

                              </p>

                              <p style="text-align: right;">

                              <h:panelGroup rendered="#{(profileBean.canEditEmployer or adminBean.isAdmin(profileBean.user, userBean.user)) and not job.defaultJob}">

                                  <small>

                                      <h:panelGroup rendered="#{profileBean.canEditEmployer}">

                                          <h:link outcome="/messaging/inbox">

                                              <f:param name="search" value="#{job.jobTitle}"/>

                                              Applicants

                                          </h:link>

                                      </h:panelGroup>

                                      <h:panelGroup rendered="#{adminBean.isAdmin(profileBean.user, userBean.user)}">

                                          <h:link outcome="/messaging/admininbox">

                                              <f:param name="search" value="#{job.jobTitle}"/>

                                              <f:param name="id" value="#{profileBean.user.id}"/>

                                              Applicants

                                          </h:link>                               

                                      </h:panelGroup>

                                      <span class="badge" id="job-applicants">

                                          <ui:fragment rendered="#{job.jobApplicants.size() ne 0}">

                                              <a href="javascript:toggleApplicants();">#{job.jobApplicants.size()}</a>

                                          </ui:fragment>

                                          <ui:fragment rendered="#{job.jobApplicants.size() eq 0}">

                                              0

                                          </ui:fragment>

                                      </span>

                                      <div id="job-applicants_list" style="display: none;">

                                      <ul><ui:repeat value="#{job.jobApplicants}" var="app">

                                          <li><h:link outcome="/user/profile">

                                              <f:param name="id" value="#{app.applicantId}"/>

                                              #{profileBean.getUserNameById(app.applicantId)}

                                          </h:link></li>

                                      </ui:repeat></ul>

                                      </div>

                                  </small>

                              </h:panelGroup>

                              </p>

                          </div>

                      </ui:repeat>

                      <h:panelGroup rendered="#{profileBean.canEditEmployer}" layout="block">

                          <h:link outcome="editjob">

                              <i class="icon-fixed-width icon-plus"></i> Add job

                              <f:param name="job" value="0"/>

                          </h:link>

                          <h:link outcome="widget">

                              <i class="icon-fixed-width icon-plus"></i> Create Widget

                              <f:param name="type" value="job"/>

                          </h:link>

                      </h:panelGroup>

                      <h:panelGroup rendered="#{adminBean.isAdmin(profileBean.user, userBean.user)}" layout="block" styleClass="pull-right">

                          <h:link outcome="admineditjob">

                              <i class="icon-fixed-width icon-plus"></i> Add job

                              <f:param name="job" value="0" />

                              <f:param name="id" value="#{profileBean.user.id}" />

                          </h:link>

                      </h:panelGroup>

                  </h:form>

                  </div>

       

                  <div id="deals">

                  <h:form id="DealForm">

                      <h3 class="dateview"></h3>

                      <div class="calenderbar"></div>

                      <ui:fragment rendered="#{empty profileBean.employerDeals}">

                          <div class="DealBox" data-date="0-0-0">

                              <p>None entered</p>

                          </div>

                      </ui:fragment>

                      <div class="DealBox2 NoDeals">No deals to display.</div>

                      <ui:repeat value="#{profileBean.employerDeals}" var="deal">

                      <ui:repeat value="#{deal.timeCache}" var="tc">

                          <div class="DealBox" data-date="#{tc.dealDate}">

                              <h:panelGroup rendered="#{deal.dealPictureId != 0}">

                                  <img src="../rest/fileservice/thumbbyid/#{profileBean.user.id}/#{deal.dealPictureId}" width="90" style="float: left; padding-right: 10px;" />

                              </h:panelGroup>

                              <h:panelGroup rendered="#{deal.dealPictureId == 0}">

                                  <img src="#{request.contextPath}/img/GreyAvatar140x140.jpg" width="90" style="float: left; padding-right: 10px;" />

                              </h:panelGroup>

                              <h3>

                                  <div style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">

                                      <h:link outcome="deal">

                                          <f:param name="deal" value="#{deal.id}"/>

                                          <f:param name="dt" value="#{tc.id}"/>

                                          <f:param name="id" value="#{profileBean.user.id}"/>

                                          #{deal.dealTitle}

                                      </h:link>

                                  </div>

                                  <h:panelGroup rendered="#{profileBean.canEditEmployer}" layout="block" styleClass="pull-right settings">

                                      <div class="dropdown">

                                          <a data-toggle="dropdown" href="#"><img src="/img/arrow-down.png"/> <img src="/img/glyphicons-gears.png"/></a>

                                          <ul class="dropdown-menu pull-right" style="font-size: 8pt;" role="menu">

                                              <li><h:link outcome="editdeal">

                                                  <i class="icon-fixed-width icon-pencil"></i> edit

                                                  <f:param name="deal" value="#{deal.id}"/>

                                              </h:link></li>

                                              <li><h:commandLink action="#{dealBean.deleteTimeCache(deal, tc)}">

                                                  <i class="icon-fixed-width icon-trash"></i> remove

                                              </h:commandLink></li>

                                              <li><h:commandLink action="#{dealBean.delete(deal)}">

                                                  <i class="icon-fixed-width icon-trash"></i> remove all

                                              </h:commandLink></li>

                                          </ul>

                                      </div>

                                  </h:panelGroup>

                                  <h:panelGroup rendered="#{adminBean.isAdmin(profileBean.user, userBean.user)}" layout="block" styleClass="pull-right">

                                      <div class="dropdown">

                                          <a data-toggle="dropdown" href="#"><img src="/img/arrow-down.png"/> <img src="/img/glyphicons-gears.png"/></a>

                                          <ul class="dropdown-menu pull-right" style="font-size: 8pt;" role="menu">

                                              <li><h:link outcome="admineditdeal">

                                                  <i class="icon-fixed-width icon-pencil"></i> edit

                                                  <f:param name="id" value="#{profileBean.user.id}" />

                                                  <f:param name="deal" value="#{deal.id}" />

                                              </h:link></li>

                                              <li><h:commandLink action="#{adminBean.deleteDealTimeCache(profileBean.user, deal, tc)}">

                                                  <i class="icon-fixed-width icon-trash"></i> remove

                                              </h:commandLink></li>

                                              <li><h:commandLink action="#{adminBean.deleteDeal(profileBean.user, deal)}">

                                                  <i class="icon-fixed-width icon-trash"></i> remove all

                                              </h:commandLink></li>

                                          </ul>

                                      </div>

                                  </h:panelGroup>

                              </h3>

                                  <div class="fb-share-button" data-href="http://industryhunt.com/user/deal.jsf?deal=#{deal.id}&amp;id=#{profileBean.user.id}" data-type="icon"></div>

                                  <div id="custom-tweet-button" class="deal-tweet"><a href="https://twitter.com/share?url=http://industryhunt.com/user/deal.jsf?deal=#{deal.id}%26id=#{profileBean.user.id}" target="_blank"><img src="https://twitter.com/favicons/favicon.ico" width="14px" height="14px"/></a></div>

                              <p>#{deal.formatDateString(tc.dealDate)}</p>

                              <p><h:outputText escape="false" value="#{deal.dealDescription}"/></p>

                          </div>

                      </ui:repeat>

                      </ui:repeat>

       

                      <ui:fragment rendered="#{(profileBean.canEditEmployer or adminBean.isAdmin(profileBean.user, userBean.user)) and not profileBean.emptyDeals}">

                          <h2>Expired Deals <a href="javascript:toggleExpired();"><img src="/img/arrow-down.png"/></a></h2>

                          <div id="ExpiredDeals" style="display: none;">

                          <ui:repeat value="#{profileBean.employerDeals}" var="deal">

                              <ui:fragment rendered="#{deal.deleteDeal}">

                                  <div class="DealBox2">

                                  <h:panelGroup rendered="#{deal.dealPictureId != 0}">

                                      <img src="../rest/fileservice/thumbbyid/#{profileBean.user.id}/#{deal.dealPictureId}" width="80" style="float: left; padding-right: 10px;" />

                                  </h:panelGroup>

                                  <h:panelGroup rendered="#{deal.dealPictureId == 0}">

                                      <img src="#{request.contextPath}/img/GreyAvatar140x140.jpg" width="80" style="float: left; padding-right: 10px;" />

                                  </h:panelGroup>

                                      <h3>

                                          <div style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">

                                              <h:link outcome="deal">

                                                  <f:param name="deal" value="#{deal.id}"/>

                                                  <f:param name="dt" value="#{tc.id}"/>

                                                  <f:param name="id" value="#{profileBean.user.id}"/>

                                                  #{deal.dealTitle}

                                              </h:link>

                                          </div>

                                          <div class="fb-share-button" data-href="http://industryhunt.com/user/deal.jsf?deal=#{deal.id}&amp;id=#{profileBean.user.id}" data-type="icon"></div>

                                          <div id="custom-tweet-button"><a href="https://twitter.com/share?url=http://industryhunt.com/user/deal.jsf?deal=#{deal.id}%26id=#{profileBean.user.id}" target="_blank"><img src="https://twitter.com/favicons/favicon.ico" width="14px" height="14px"/></a></div>

                                          <h:panelGroup rendered="#{profileBean.canEditEmployer}" layout="block" styleClass="pull-right settings">

                                              <div class="dropdown">

                                                  <a data-toggle="dropdown" href="#"><img src="/img/arrow-down.png"/> <img src="/img/glyphicons-gears.png"/></a>

                                                  <ul class="dropdown-menu pull-right" style="font-size: 8pt;" role="menu">

                                                      <li><h:link outcome="editdeal">

                                                          <i class="icon-fixed-width icon-pencil"></i> edit

                                                          <f:param name="deal" value="#{deal.id}"/>

                                                      </h:link></li>

                                                      <li><h:commandLink action="#{dealBean.deleteTimeCache(deal, tc)}">

                                                          <i class="icon-fixed-width icon-trash"></i> remove

                                                      </h:commandLink></li>

                                                      <li><h:commandLink action="#{dealBean.delete(deal)}">

                                                          <i class="icon-fixed-width icon-trash"></i> remove all

                                                      </h:commandLink></li>

                                                  </ul>

                                              </div>

                                          </h:panelGroup>

                                          <h:panelGroup rendered="#{adminBean.isAdmin(profileBean.user, userBean.user)}" layout="block" styleClass="pull-right">

                                              <div class="dropdown">

                                                  <a data-toggle="dropdown" href="#"><img src="/img/arrow-down.png"/> <img src="/img/glyphicons-gears.png"/></a>

                                                  <ul class="dropdown-menu pull-right" style="font-size: 8pt;" role="menu">

                                                      <li><h:link outcome="admineditdeal">

                                                          <i class="icon-fixed-width icon-pencil"></i> edit

                                                          <f:param name="id" value="#{profileBean.user.id}" />

                                                          <f:param name="deal" value="#{deal.id}" />

                                                      </h:link></li>

                                                      <li><h:commandLink action="#{adminBean.deleteDealTimeCache(profileBean.user, deal, tc)}">

                                                          <i class="icon-fixed-width icon-trash"></i> remove

                                                      </h:commandLink></li>

                                                      <li><h:commandLink action="#{adminBean.deleteDeal(profileBean.user, deal)}">

                                                          <i class="icon-fixed-width icon-trash"></i> remove all

                                                      </h:commandLink></li>

                                                  </ul>

                                              </div>

                                          </h:panelGroup>

                                      </h3>

                                      <p>#{deal.formatDateString(tc.dealDate)}</p>

                                      <p><h:outputText escape="false" value="#{deal.dealDescription}"/></p>

                                  </div>

                              </ui:fragment>

                          </ui:repeat>

                          </div>

                      </ui:fragment>

       

                      <h:panelGroup rendered="#{profileBean.canEditEmployer}" layout="block">

                          <h:link outcome="editdeal">

                              <i class="icon-fixed-width icon-plus"></i> Add deal

                              <f:param name="deal" value="0"/>

                          </h:link>

                          <h:link outcome="widget">

                              <i class="icon-fixed-width icon-plus"></i> Create Widget

                              <f:param name="type" value="deal"/>

                          </h:link>

                      </h:panelGroup>

                      <h:panelGroup rendered="#{adminBean.isAdmin(profileBean.user, userBean.user)}" layout="block" styleClass="pull-right">

                          <h:link outcome="admineditdeal">

                              <i class="icon-fixed-width icon-plus"></i> Add deal

                              <f:param name="deal" value="0" />

                              <f:param name="id" value="#{profileBean.user.id}" />

                          </h:link>

                      </h:panelGroup>

                  </h:form>

                  </div>

              </ui:fragment>

          </div>

      </ui:composition>