{"id":1374,"date":"2012-06-19T01:00:00","date_gmt":"2012-06-19T01:00:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/full-webapplication-jsf-ejb-jpa-jaas-part-2.html"},"modified":"2012-10-22T05:33:19","modified_gmt":"2012-10-22T05:33:19","slug":"full-webapplication-jsf-ejb-jpa-jaas_19","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html","title":{"rendered":"Full WebApplication JSF EJB JPA JAAS &#8211; Part 2"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\"><b>View \u2013 Creation and JSF set up<\/strong><\/p>\n<p>This tutorial continues from <a href=\"http:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas.html\">part 1<\/a>.<\/p>\n<p>Let us create a new <strong><em>Dynamic Web Project<\/em><\/strong>. Create it like the image bellow:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-aHKl42sIYN4\/T9-A8jwKldI\/AAAAAAAAAps\/ttvQ9bHMvI8\/s1600\/10-300x285.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/3.bp.blogspot.com\/-aHKl42sIYN4\/T9-A8jwKldI\/AAAAAAAAAps\/ttvQ9bHMvI8\/s1600\/10-300x285.png\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/4.bp.blogspot.com\/-zFgMjvy4c2k\/T9-BCvmp21I\/AAAAAAAAAp0\/WQkJfzcbEDw\/s1600\/11-221x300.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/4.bp.blogspot.com\/-zFgMjvy4c2k\/T9-BCvmp21I\/AAAAAAAAAp0\/WQkJfzcbEDw\/s1600\/11-221x300.png\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/4.bp.blogspot.com\/-iNQGqgjONTo\/T9-BIczKmOI\/AAAAAAAAAp8\/5fUp1dyXb2g\/s1600\/12-221x300.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/4.bp.blogspot.com\/-iNQGqgjONTo\/T9-BIczKmOI\/AAAAAAAAAp8\/5fUp1dyXb2g\/s1600\/12-221x300.png\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/4.bp.blogspot.com\/-7QCKkJn7Jg0\/T9-BO_eo5SI\/AAAAAAAAAqE\/sjqsba0em-8\/s1600\/13-221x300.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/4.bp.blogspot.com\/-7QCKkJn7Jg0\/T9-BO_eo5SI\/AAAAAAAAAqE\/sjqsba0em-8\/s1600\/13-221x300.png\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/-WkqUNzWsAXg\/T9-BWyAQttI\/AAAAAAAAAqM\/CXZXeitPgXY\/s1600\/14-221x300.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/2.bp.blogspot.com\/-WkqUNzWsAXg\/T9-BWyAQttI\/AAAAAAAAAqM\/CXZXeitPgXY\/s1600\/14-221x300.png\" \/><\/a><\/div>\n<p>Pay attention: in some moment the Eclipse will ask you if you want to add the JSF Capabilities (auto complete), enable it. Like the screens bellow:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/1.bp.blogspot.com\/-hPs_trlqyRc\/T9-Bhsb_N6I\/AAAAAAAAAqU\/qbREgLDRIcI\/s1600\/14b-300x105.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/1.bp.blogspot.com\/-hPs_trlqyRc\/T9-Bhsb_N6I\/AAAAAAAAAqU\/qbREgLDRIcI\/s1600\/14b-300x105.png\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-W5QYrQC4ago\/T9-BpqyRPQI\/AAAAAAAAAqc\/MmsnFz8Fj9k\/s1600\/14c-300x153.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/3.bp.blogspot.com\/-W5QYrQC4ago\/T9-BpqyRPQI\/AAAAAAAAAqc\/MmsnFz8Fj9k\/s1600\/14c-300x153.png\" \/><\/a><\/div>\n<p>After the project creation, let us edit the \u201cweb.xml\u201d file; it should have the same code as bellow:        <\/p>\n<pre class=\"brush:xml\">&lt;?xml version='1.0' encoding='UTF-8'?&gt;\r\n&lt;web-app xmlns:xsi='http:\/\/www.w3.org\/2001\/XMLSchema-instance'\r\n xmlns='http:\/\/java.sun.com\/xml\/ns\/javaee' xmlns:web='http:\/\/java.sun.com\/xml\/ns\/javaee\/web-app_2_5.xsd'\r\n xsi:schemaLocation='http:\/\/java.sun.com\/xml\/ns\/javaee http:\/\/java.sun.com\/xml\/ns\/javaee\/web-app_3_0.xsd'\r\n id='WebApp_ID' version='3.0'&gt;\r\n &lt;display-name&gt;CrudJSF&lt;\/display-name&gt;\r\n &lt;welcome-file-list&gt;\r\n  &lt;welcome-file&gt;pages\/protected\/user\/listAllDogs.xhtml&lt;\/welcome-file&gt;\r\n &lt;\/welcome-file-list&gt;\r\n &lt;servlet&gt;\r\n  &lt;servlet-name&gt;Faces Servlet&lt;\/servlet-name&gt;\r\n  &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;\/servlet-class&gt;\r\n  &lt;load-on-startup&gt;1&lt;\/load-on-startup&gt;\r\n &lt;\/servlet&gt;\r\n &lt;servlet-mapping&gt;\r\n  &lt;servlet-name&gt;Faces Servlet&lt;\/servlet-name&gt;\r\n  &lt;url-pattern&gt;\/faces\/*&lt;\/url-pattern&gt;\r\n  &lt;url-pattern&gt;*.jsf&lt;\/url-pattern&gt;\r\n  &lt;url-pattern&gt;*.xhtml&lt;\/url-pattern&gt;\r\n &lt;\/servlet-mapping&gt;\r\n\r\n &lt;!-- Protected area definition --&gt;\r\n &lt;security-constraint&gt;\r\n  &lt;web-resource-collection&gt;\r\n   &lt;web-resource-name&gt;Restricted Area - ADMIN Only&lt;\/web-resource-name&gt;\r\n   &lt;url-pattern&gt;\/pages\/protected\/admin\/*&lt;\/url-pattern&gt;\r\n  &lt;\/web-resource-collection&gt;\r\n  &lt;auth-constraint&gt;\r\n   &lt;role-name&gt;ADMIN&lt;\/role-name&gt;\r\n  &lt;\/auth-constraint&gt;\r\n &lt;\/security-constraint&gt;\r\n &lt;security-constraint&gt;\r\n  &lt;web-resource-collection&gt;\r\n   &lt;web-resource-name&gt;Restricted Area - USER and ADMIN&lt;\/web-resource-name&gt;\r\n   &lt;url-pattern&gt;\/pages\/protected\/user\/*&lt;\/url-pattern&gt;\r\n  &lt;\/web-resource-collection&gt;\r\n  &lt;auth-constraint&gt;\r\n   &lt;role-name&gt;USER&lt;\/role-name&gt;\r\n   &lt;role-name&gt;ADMIN&lt;\/role-name&gt;\r\n  &lt;\/auth-constraint&gt;\r\n &lt;\/security-constraint&gt;\r\n\r\n &lt;!-- Login page --&gt;\r\n &lt;login-config&gt;\r\n  &lt;auth-method&gt;FORM&lt;\/auth-method&gt;\r\n  &lt;form-login-config&gt;\r\n   &lt;form-login-page&gt;\/pages\/public\/login.xhtml&lt;\/form-login-page&gt;\r\n   &lt;form-error-page&gt;\/pages\/public\/loginError.xhtml&lt;\/form-error-page&gt;\r\n  &lt;\/form-login-config&gt;\r\n &lt;\/login-config&gt;\r\n\r\n &lt;!-- System roles --&gt;\r\n &lt;security-role&gt;\r\n  &lt;role-name&gt;ADMIN&lt;\/role-name&gt;\r\n &lt;\/security-role&gt;\r\n &lt;security-role&gt;\r\n  &lt;role-name&gt;USER&lt;\/role-name&gt;\r\n &lt;\/security-role&gt;\r\n&lt;\/web-app&gt;<\/pre>\n<p>You do not have to worry if some warning\/error shows up; we will solve them later. Notice that I have added all the JAAS code that we will need (If you want a detailed post about these JAAS configurations you can check it here: <a href=\"http:\/\/uaihebert.com\/?p=55\" title=\"User Login Validation with JAAS and JSF\">User Login Validation with JAAS and JSF<\/a>).        <\/p>\n<p>According to the JAAS configurations a regular user (USER role) will only see the files inside the user folder, that will be only the listing of the dogs recorded in our database; the ADMIN will be able to do all the CRUD actions because all the pages are inside the admins folder.        <\/p>\n<p>Our \u201cfaces-config.xml\u201d should have the code bellow:        <\/p>\n<pre class=\"brush:java\">&lt;?xml version='1.0' encoding='UTF-8'?&gt;\r\n\r\n&lt;faces-config\r\n    xmlns='http:\/\/java.sun.com\/xml\/ns\/javaee'\r\n    xmlns:xsi='http:\/\/www.w3.org\/2001\/XMLSchema-instance'\r\n    xsi:schemaLocation='http:\/\/java.sun.com\/xml\/ns\/javaee http:\/\/java.sun.com\/xml\/ns\/javaee\/web-facesconfig_2_0.xsd'\r\n    version='2.0'&gt;\r\n\r\n &lt;navigation-rule&gt;\r\n  &lt;navigation-case&gt;\r\n   &lt;from-outcome&gt;logout&lt;\/from-outcome&gt;\r\n   &lt;to-view-id&gt;\/pages\/protected\/user\/listAllDogs.xhtml&lt;\/to-view-id&gt;\r\n   &lt;redirect\/&gt;\r\n  &lt;\/navigation-case&gt;\r\n &lt;\/navigation-rule&gt;\r\n &lt;navigation-rule&gt;\r\n  &lt;navigation-case&gt;\r\n   &lt;from-outcome&gt;listAllDogs&lt;\/from-outcome&gt;\r\n   &lt;to-view-id&gt;\/pages\/protected\/user\/listAllDogs.xhtml&lt;\/to-view-id&gt;\r\n  &lt;\/navigation-case&gt;\r\n &lt;\/navigation-rule&gt;\r\n &lt;navigation-rule&gt;\r\n  &lt;navigation-case&gt;\r\n   &lt;from-outcome&gt;createDog&lt;\/from-outcome&gt;\r\n   &lt;to-view-id&gt;\/pages\/protected\/admin\/createDog.xhtml&lt;\/to-view-id&gt;\r\n   &lt;redirect\/&gt;\r\n  &lt;\/navigation-case&gt;\r\n &lt;\/navigation-rule&gt;\r\n &lt;navigation-rule&gt;\r\n  &lt;navigation-case&gt;\r\n   &lt;from-outcome&gt;updateDog&lt;\/from-outcome&gt;\r\n   &lt;to-view-id&gt;\/pages\/protected\/admin\/updateDog.xhtml&lt;\/to-view-id&gt;\r\n  &lt;\/navigation-case&gt;\r\n &lt;\/navigation-rule&gt;\r\n &lt;navigation-rule&gt;\r\n  &lt;navigation-case&gt;\r\n   &lt;from-outcome&gt;deleteDog&lt;\/from-outcome&gt;\r\n   &lt;to-view-id&gt;\/pages\/protected\/admin\/deleteDog.xhtml&lt;\/to-view-id&gt;\r\n  &lt;\/navigation-case&gt;\r\n &lt;\/navigation-rule&gt;\r\n\r\n &lt;application&gt;\r\n  &lt;resource-bundle&gt;\r\n   &lt;base-name&gt;messages&lt;\/base-name&gt;\r\n   &lt;var&gt;msgs&lt;\/var&gt;\r\n  &lt;\/resource-bundle&gt;\r\n &lt;\/application&gt;\r\n\r\n&lt;\/faces-config&gt;<\/pre>\n<p>Notice that to some actions I used the redirect action. With this action we will update the requested link in the URL bar of the browser, after the URL get updated the JAAS will deny access to an illegal user.        <\/p>\n<p>We also have a file that will contain all the messages of our system. You will notice that all the texts displayed in our pages are in this file (create a file named \u201cmessages.properties\u201d inside the src folder):        <\/p>\n<pre class=\"brush:java\">#Dog\r\ndog=Dog\r\ndogName=Name\r\ndogWeight=Weight\r\n\r\n#Dog messages\r\ndogCreateHeader=Create a new Dog\r\ndogUpdateHeader=Update the Dog\r\ndogDeleteHeader=Delete this Dog\r\ndogNameRequired=The dog needs a name.\r\ndogWeightRequired=The dog needs a weight.\r\n\r\n#Actions\r\nupdate=Update\r\ncreate=Create\r\ndelete=Delete\r\ncancel=Cancel\r\n\r\n#Login\r\nloginHello=Hello\r\nloginErrorMessage=Could not login. Check you UserName\/Password\r\nloginUserName=Username\r\nloginPassword=Password\r\nlogout=Log Out<\/pre>\n<p><strong>View \u2013 Creation and JSF set up<\/strong>       <\/p>\n<p>Let us now create the ManagedBeans.        <\/p>\n<p>First, we need to add the EJB to the Web Project. Right click with your mouse on the JSF project &gt; Properties:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/-1hAQR_ZZGGg\/T9-B09wNkYI\/AAAAAAAAAqk\/zCii1ts1088\/s1600\/15-180x300.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/2.bp.blogspot.com\/-1hAQR_ZZGGg\/T9-B09wNkYI\/AAAAAAAAAqk\/zCii1ts1088\/s1600\/15-180x300.png\" \/><\/a><\/div>\n<p>Java Build Path &gt; Projects &gt; Add &gt; Check CrudEJB &gt; OK<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/-WpwS--4j630\/T9-B83px6LI\/AAAAAAAAAqs\/VaSQjFWbJDE\/s1600\/16-300x281.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/2.bp.blogspot.com\/-WpwS--4j630\/T9-B83px6LI\/AAAAAAAAAqs\/VaSQjFWbJDE\/s1600\/16-300x281.png\" \/><\/a><\/div>\n<p>First, let us create the DogMB:        <\/p>\n<pre class=\"brush:java\">package com.mb;\r\n\r\nimport java.util.List;\r\n\r\nimport javax.ejb.EJB;\r\nimport javax.ejb.EJBException;\r\nimport javax.faces.application.FacesMessage;\r\nimport javax.faces.bean.ManagedBean;\r\nimport javax.faces.bean.RequestScoped;\r\nimport javax.faces.context.FacesContext;\r\n\r\nimport com.facade.DogFacade;\r\nimport com.model.Dog;\r\n\r\n@ManagedBean\r\n@RequestScoped\r\npublic class DogMB {\r\n\r\n @EJB\r\n private DogFacade dogFacade;\r\n\r\n private static final String CREATE_DOG = 'createDog';\r\n private static final String DELETE_DOG = 'deleteDog';\r\n private static final String UPDATE_DOG = 'updateDog';\r\n private static final String LIST_ALL_DOGS = 'listAllDogs';\r\n private static final String STAY_IN_THE_SAME_PAGE = null;\r\n\r\n private Dog dog;\r\n\r\n public Dog getDog() {\r\n\r\n  if(dog == null){\r\n   dog = new Dog();\r\n  }\r\n\r\n  return dog;\r\n }\r\n\r\n public void setDog(Dog dog) {\r\n  this.dog = dog;\r\n }\r\n\r\n public List&lt;Dog&gt; getAllDogs() {\r\n  return dogFacade.findAll();\r\n }\r\n\r\n public String updateDogStart(){\r\n  return UPDATE_DOG;\r\n }\r\n\r\n public String updateDogEnd(){\r\n  try {\r\n   dogFacade.update(dog);\r\n  } catch (EJBException e) {\r\n   sendErrorMessageToUser('Error. Check if the weight is above 0 or call the adm');\r\n   return STAY_IN_THE_SAME_PAGE;\r\n  }\r\n\r\n  sendInfoMessageToUser('Operation Complete: Update');\r\n  return LIST_ALL_DOGS;\r\n }\r\n\r\n public String deleteDogStart(){\r\n  return DELETE_DOG;\r\n }\r\n\r\n public String deleteDogEnd(){\r\n  try {\r\n   dogFacade.delete(dog);\r\n  } catch (EJBException e) {\r\n   sendErrorMessageToUser('Error. Call the ADM');\r\n   return STAY_IN_THE_SAME_PAGE;\r\n  }   \r\n\r\n  sendInfoMessageToUser('Operation Complete: Delete');\r\n\r\n  return LIST_ALL_DOGS;\r\n }\r\n\r\n public String createDogStart(){\r\n  return CREATE_DOG;\r\n }\r\n\r\n public String createDogEnd(){\r\n  try {\r\n   dogFacade.save(dog);\r\n  } catch (EJBException e) {\r\n   sendErrorMessageToUser('Error. Check if the weight is above 0 or call the adm');\r\n\r\n   return STAY_IN_THE_SAME_PAGE;\r\n  }  \r\n\r\n  sendInfoMessageToUser('Operation Complete: Create');\r\n\r\n  return LIST_ALL_DOGS;\r\n }\r\n\r\n public String listAllDogs(){\r\n  return LIST_ALL_DOGS;\r\n }\r\n\r\n private void sendInfoMessageToUser(String message){\r\n  FacesContext context = getContext();\r\n  context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, message, message));\r\n }\r\n\r\n private void sendErrorMessageToUser(String message){\r\n  FacesContext context = getContext();\r\n  context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));\r\n }\r\n\r\n private FacesContext getContext() {\r\n  FacesContext context = FacesContext.getCurrentInstance();\r\n  return context;\r\n }\r\n}<\/pre>\n<p>About the code above:        <div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<ul>\n<li>All navigation you will find in the faces-config.xml. You should use constants or a resource bundle with the navigations of your pages; this approach is a better approach than just leave strings in your methods.<\/li>\n<li>Notice that we are only using @EJB to inject the EJB inside of the MB. This happens because we are using everything inside the same EAR. The JBoss 7 turns easy this localization.<\/li>\n<li>If the injection does not work with JBoss 6 (or if you are using the EJB jar outside the EAR) you can use the injection like this:  @EJB(mappedName=\u201cDogFacadeImp\/local\u201d).<\/li>\n<li>Notice that a message is displayed to the user of our system. We have a try\/catch to each action that we execute in the Fa\u00e7ade, if some error happens we will send an error message to the user.<\/li>\n<li>The correct actions would be to validate the data in the ManagedBean and in the Fa\u00e7ade. Those validations have a low CPU cost.<\/li>\n<li>If you are using the JBoss 4.2 you will need to do a JNDI lookup like the code bellow(just like a said earlier in this post use the LocalBinding annotation). Annotate your class like this:\n<pre class=\"brush:java\">@Stateless\r\n@LocalBinding(jndiBinding='MyBean')\r\npublic class MyBeanImp implements MyBean{\r\n @Override\r\n public String hello() {\r\n  return 'Value From EJB';\r\n }\r\n}\r\n\/\/ In your Servlet class you would lookup like the code bellow:\r\npublic class Inject extends HttpServlet {\r\n\r\n private MyBean local;\r\n\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n  try {\r\n   InitialContext iniCtx = new InitialContext();\r\n   local = (MyBean) iniCtx.lookup('MyBean');\r\n  } catch (NamingException e) {\r\n   e.printStackTrace();\r\n  }\r\n\r\n  System.out.println(local.hello());\r\n  request.getRequestDispatcher('\/finish.jsp').forward(request, response);\r\n }\r\n\r\n \/**\r\n  * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)\r\n  *\/\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\r\n\r\n }\r\n}<\/pre>\n<\/li>\n<\/ul>\n<p>Now Let us see the UserMB:        <\/p>\n<pre class=\"brush:java\">package com.mb;\r\n\r\nimport javax.ejb.EJB;\r\nimport javax.faces.bean.ManagedBean;\r\nimport javax.faces.bean.SessionScoped;\r\nimport javax.faces.context.ExternalContext;\r\nimport javax.faces.context.FacesContext;\r\nimport javax.servlet.http.HttpServletRequest;\r\n\r\nimport com.facade.UserFacade;\r\nimport com.model.User;\r\n\r\n@SessionScoped\r\n@ManagedBean\r\npublic class UserMB {\r\n private User user;\r\n\r\n @EJB\r\n private UserFacade userFacade;\r\n\r\n public User getUser(){\r\n  if(user == null){\r\n   ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();\r\n   String userEmail = context.getUserPrincipal().getName();\r\n\r\n   user = userFacade.findUserByEmail(userEmail);\r\n  }\r\n\r\n  return user;\r\n }\r\n\r\n public boolean isUserAdmin(){\r\n  return getRequest().isUserInRole('ADMIN');\r\n }\r\n\r\n public String logOut(){\r\n  getRequest().getSession().invalidate();\r\n  return 'logout';\r\n }\r\n\r\n private HttpServletRequest getRequest() {\r\n  return (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\r\n }\r\n}<\/pre>\n<p>About the code above:        <\/p>\n<ul>\n<li>This MB is only used to store the session user of our application. You will use this MB to display the user name or any other action regarding the user of the application.<\/li>\n<li>Notice that this is a Session MB; we check just one time if the user is null, and if returns true, we will go to the database. With this condition we will go just once to the database saving performance.<\/li>\n<li>If the @EJB injection raises an exception, check the tips given in the DogMB above.<\/li>\n<\/ul>\n<p><strong>View \u2013 Pages<\/strong>       <\/p>\n<p>Bellow the pages, css and its respective paths:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-mx6T1HCeZ80\/T9-CN41TnnI\/AAAAAAAAAq0\/Fs_PXuzzhgs\/s1600\/17+(1).png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/3.bp.blogspot.com\/-mx6T1HCeZ80\/T9-CN41TnnI\/AAAAAAAAAq0\/Fs_PXuzzhgs\/s1600\/17+(1).png\" \/><\/a><\/div>\n<p><em>Do not mind with the interrogation icons or any other icon type that is displayed in the picture above. Those are versioning icons that points to my code. Always save your code. <\/em>       <\/p>\n<p>I am using RequestScope in the ManagedBean, which is why you will see the h:inputHidden in all my pages. I think it is a better approach for you to repeat this field with RequestScope MBs because you will have more free memory in your server instead using SessionScope MBs.        <\/p>\n<p><strong><em>\/WebContent\/resources\/css\/main.css<\/em><\/strong>       <\/p>\n<pre class=\"brush:java\">.table {\r\n border-collapse: collapse;\r\n}\r\n\r\n.tableColumnsHeader {\r\n text-align: center;\r\n background: none repeat scroll 0 0 #E5E5E5;\r\n border-bottom: 1px solid #BBBBBB;\r\n padding: 16px;\r\n}\r\n\r\n.tableFirstLine {\r\n text-align: center;\r\n background: none repeat scroll 0 0 #F9F9F9;\r\n border-top: 1px solid #BBBBBB;\r\n}\r\n\r\n.tableNextLine {\r\n text-align: center;\r\n background: none repeat scroll 0 0 #FFFFFFF;\r\n border-top: 1px solid #BBBBBB;\r\n}\r\n\r\n.panelGrid {\r\n border: 1px solid;\r\n}\r\n\r\n.panelFirstLine {\r\n text-align: center;\r\n border-top: 1px solid #BBBBBB;\r\n}\r\n\r\n.panelNextLine {\r\n text-align: center;\r\n border-top: 1px solid #BBBBBB;\r\n}<\/pre>\n<p><strong><em>\/WebContent\/pages\/public\/login.xhtml<\/em><\/strong>       <\/p>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN'\r\n  'http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd'&gt;\r\n&lt;html xmlns='http:\/\/www.w3.org\/1999\/xhtml'\r\n xmlns:f='http:\/\/java.sun.com\/jsf\/core'\r\n xmlns:h='http:\/\/java.sun.com\/jsf\/html'\r\n xmlns:ui='http:\/\/java.sun.com\/jsf\/facelets'&gt;\r\n&lt;h:head&gt;\r\n &lt;h:outputStylesheet library='css' name='main.css' \/&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n &lt;p&gt;Login to access secure pages:&lt;\/p&gt;\r\n &lt;form method='post' action='j_security_check'&gt;\r\n  &lt;h:messages layout='table' errorStyle='background: #AFEEEE;'\r\n   infoStyle='background: #AFEEEE;' globalOnly='true' \/&gt;\r\n  &lt;h:panelGrid columns='2'&gt;\r\n   &lt;h:outputLabel value='Username: ' \/&gt;\r\n   &lt;input type='text' id='j_username' name='j_username' \/&gt;\r\n   &lt;h:outputLabel value='Password: ' \/&gt;\r\n   &lt;input type='password' id='j_password' name='j_password' \/&gt;\r\n   &lt;h:outputText value='' \/&gt;\r\n   &lt;h:panelGrid columns='1'&gt;\r\n    &lt;input type='submit' name='submit' value='Login' \/&gt;\r\n   &lt;\/h:panelGrid&gt;\r\n  &lt;\/h:panelGrid&gt;\r\n  &lt;br \/&gt;\r\n &lt;\/form&gt;\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>Notice how we import the css like if it was a library. The action that you see in the form tag, points to an unknown action to us, but is the JAAS the responsible to manage that.<br \/>\n<strong><em>\/WebContent\/pages\/public\/loginError.xhtml<\/em><\/strong>       <\/p>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN'\r\n  'http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd'&gt;\r\n&lt;html xmlns='http:\/\/www.w3.org\/1999\/xhtml'\r\n xmlns:f='http:\/\/java.sun.com\/jsf\/core'\r\n xmlns:h='http:\/\/java.sun.com\/jsf\/html'\r\n xmlns:ui='http:\/\/java.sun.com\/jsf\/facelets'&gt;\r\n&lt;h:head&gt;\r\n &lt;h:outputStylesheet library='css' name='main.css' \/&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n #{msgs.loginErrorMessage}\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p><strong><em>\/WebContent\/pages\/protected\/user\/listAllDogs.xhtml<\/em><\/strong>       <\/p>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN'\r\n  'http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd'&gt;\r\n&lt;html xmlns='http:\/\/www.w3.org\/1999\/xhtml'\r\n xmlns:f='http:\/\/java.sun.com\/jsf\/core'\r\n xmlns:h='http:\/\/java.sun.com\/jsf\/html'\r\n xmlns:ui='http:\/\/java.sun.com\/jsf\/facelets'&gt;\r\n&lt;h:head&gt;\r\n &lt;h:outputStylesheet library='css' name='main.css' \/&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n &lt;h:form&gt;\r\n  &lt;h3&gt;#{msgs.loginHello}: #{userMB.user.name} || &lt;h:commandLink action='#{userMB.logOut()}' value='#{msgs.logout}' \/&gt; &lt;\/h3&gt;\r\n\r\n  &lt;h:messages \/&gt;\r\n  &lt;h:dataTable value='#{dogMB.allDogs}' var='dog' styleClass='table' headerClass='tableColumnsHeader' rowClasses='tableFirstLine,tableNextLine' &gt;\r\n   &lt;h:column&gt;\r\n    &lt;f:facet name='header'&gt;\r\n     #{msgs.dogName}\r\n    &lt;\/f:facet&gt;\r\n\r\n    #{dog.name}\r\n   &lt;\/h:column&gt;\r\n   &lt;h:column&gt;\r\n    &lt;f:facet name='header'&gt;\r\n     #{msgs.dogWeight}\r\n    &lt;\/f:facet&gt;\r\n\r\n    #{dog.weight}\r\n   &lt;\/h:column&gt;\r\n   &lt;h:column&gt;\r\n    &lt;h:panelGrid columns='2'&gt;\r\n     &lt;!-- Always save the id as hidden when you use a request scope MB --&gt;\r\n     &lt;h:inputHidden value='#{dog.id}' \/&gt;\r\n\r\n     &lt;h:commandButton action='#{dogMB.updateDogStart()}' value='#{msgs.update}' rendered='#{userMB.userAdmin}' &gt;\r\n      &lt;f:setPropertyActionListener target='#{dogMB.dog}' value='#{dog}' \/&gt;\r\n     &lt;\/h:commandButton&gt;\r\n     &lt;h:commandButton action='#{dogMB.deleteDogStart()}' value='#{msgs.delete}' rendered='#{userMB.userAdmin}' &gt;\r\n      &lt;f:setPropertyActionListener target='#{dogMB.dog}' value='#{dog}' \/&gt;\r\n     &lt;\/h:commandButton&gt;\r\n    &lt;\/h:panelGrid&gt;\r\n   &lt;\/h:column&gt;\r\n  &lt;\/h:dataTable&gt;\r\n  &lt;!-- This button is displayed to the user, just to you see the error msg  --&gt;\r\n  &lt;h:commandButton action='createDog' value='#{msgs.create} #{msgs.dog}' \/&gt;\r\n &lt;\/h:form&gt;\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>About the code above:        <\/p>\n<ul>\n<li>Always remember to wrap your code with the h:form tag. There are frameworks (like Primefaces) that will not work without the h:form, h:head and h:body.<\/li>\n<li>We use the UserMB to display the user name and to logout our user.<\/li>\n<li>The &lt;h:messages \/&gt; tag will display the messages sent by the DogMB.<\/li>\n<li>Notice that in the line 33 the id is hidden. It is a necessary value if you use RequestScope instead SessionScope. I rather use RequestScope than SessionScope, your server memory will have less data in it.<\/li>\n<li>Notice that the buttons have the <em>rendered=\u201d#{userMB.userAdmin}\u201d<\/em> to indicate that only the ADMIN role will have access to the delete\/update.<\/li>\n<li>I am passing to my MB the selected dog through the tag : \u201c<strong><em>f:setPropertyActionListener<\/em><\/strong>\u201d.<\/li>\n<li>The \u201ccreate\u201d button does not have the rendered option. It is just to display to you if a regular user tries to access a page.<\/li>\n<\/ul>\n<p><strong><em>\/WebContent\/pages\/protected\/admin\/createDog.xhtml<\/em><\/strong>       <\/p>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN'\r\n  'http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd'&gt;\r\n&lt;html xmlns='http:\/\/www.w3.org\/1999\/xhtml'\r\n xmlns:f='http:\/\/java.sun.com\/jsf\/core'\r\n xmlns:h='http:\/\/java.sun.com\/jsf\/html'\r\n xmlns:ui='http:\/\/java.sun.com\/jsf\/facelets'&gt;\r\n&lt;h:head&gt;\r\n &lt;h:outputStylesheet library='css' name='main.css' \/&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n &lt;h:form&gt;\r\n  &lt;h:messages\/&gt;\r\n\r\n  &lt;h3&gt;${msgs.dogCreateHeader}&lt;\/h3&gt;\r\n  &lt;h:panelGrid columns='2' styleClass='panelGrid' rowClasses='panelFirstLine,panelNextLine' &gt;\r\n   &lt;h:outputLabel for='dogName' value='#{msgs.dogName}' \/&gt;\r\n   &lt;h:inputText id='dogName' value='#{dogMB.dog.name}' required='true' requiredMessage='#{msgs.dogNameRequired}' \/&gt;\r\n\r\n   &lt;h:outputLabel for='dogWeight' value='#{msgs.dogWeight}' \/&gt;\r\n   &lt;h:inputText id='dogWeight' value='#{dogMB.dog.weight}' required='true' requiredMessage='#{msgs.dogWeightRequired}' &gt;\r\n    &lt;f:convertNumber \/&gt;\r\n   &lt;\/h:inputText&gt;\r\n  &lt;\/h:panelGrid&gt;\r\n  &lt;h:panelGrid columns='2'&gt;\r\n   &lt;h:commandButton action='#{dogMB.createDogEnd()}' value='#{msgs.create}' \/&gt;\r\n   &lt;h:commandButton action='#{dogMB.listAllDogs()}' value='#{msgs.cancel}' immediate='true' \/&gt;\r\n  &lt;\/h:panelGrid&gt;\r\n  &lt;br\/&gt;\r\n &lt;\/h:form&gt;\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>About the code above:        <\/p>\n<ul>\n<li>The  fields name and weight are required and will print an error message if you leave it empty.<\/li>\n<li>The cancel button needs the option immediate=\u201ctrue\u201d; with this option the JSF will not validate any field.<\/li>\n<\/ul>\n<p><strong><em>\/WebContent\/pages\/protected\/admin\/deleteDog.xhtml<\/em><\/strong>       <\/p>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN'\r\n  'http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd'&gt;\r\n&lt;html xmlns='http:\/\/www.w3.org\/1999\/xhtml'\r\n xmlns:f='http:\/\/java.sun.com\/jsf\/core'\r\n xmlns:h='http:\/\/java.sun.com\/jsf\/html'\r\n xmlns:ui='http:\/\/java.sun.com\/jsf\/facelets'&gt;\r\n&lt;h:head&gt;\r\n &lt;h:outputStylesheet library='css' name='main.css' \/&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n &lt;h:form&gt;\r\n  &lt;h:messages\/&gt;\r\n\r\n  &lt;h3&gt;#{msgs.dogDeleteHeader}: #{dogMB.dog.name}?&lt;\/h3&gt;\r\n  &lt;h:inputHidden value='#{dogMB.dog.id}' \/&gt;\r\n  &lt;h:panelGrid columns='2'&gt;\r\n   &lt;h:commandButton action='#{dogMB.deleteDogEnd()}' value='#{msgs.delete}' \/&gt;\r\n   &lt;h:commandButton action='#{dogMB.listAllDogs()}' value='#{msgs.cancel}' immediate='true' \/&gt;\r\n  &lt;\/h:panelGrid&gt;\r\n  &lt;br\/&gt;\r\n &lt;\/h:form&gt;\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>Notice that in the line 15 the id is hidden. It is a necessary value if you use RequestScope instead SessionScope. I rather use RequestScope than SessionScope, your server memory will have less data in it.<\/p>\n<p><strong><em>\/WebContent\/pages\/protected\/admin\/updateDog.xhtm<\/em><\/strong>l        <\/p>\n<pre class=\"brush:java\">&lt;!DOCTYPE html PUBLIC '-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN'\r\n  'http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd'&gt;\r\n&lt;html xmlns='http:\/\/www.w3.org\/1999\/xhtml'\r\n xmlns:f='http:\/\/java.sun.com\/jsf\/core'\r\n xmlns:h='http:\/\/java.sun.com\/jsf\/html'\r\n xmlns:ui='http:\/\/java.sun.com\/jsf\/facelets'&gt;\r\n&lt;h:head&gt;\r\n &lt;h:outputStylesheet library='css' name='main.css' \/&gt;\r\n&lt;\/h:head&gt;\r\n&lt;h:body&gt;\r\n &lt;h:form&gt;\r\n  &lt;h:messages\/&gt;\r\n\r\n  &lt;h3&gt;#{msgs.dogUpdateHeader}: #{dogMB.dog.name}&lt;\/h3&gt;\r\n  &lt;h:inputHidden value='#{dogMB.dog.id}' \/&gt;\r\n  &lt;h:panelGrid columns='2' styleClass='panelGrid' rowClasses='panelFirstLine,panelNextLine' &gt;\r\n   &lt;h:outputLabel for='dogName' value='#{msgs.dogName}' \/&gt;\r\n   &lt;h:inputText id='dogName' value='#{dogMB.dog.name}' required='true' requiredMessage='#{msgs.dogNameRequired}' \/&gt;\r\n\r\n   &lt;h:outputLabel for='dogWeight' value='#{msgs.dogWeight}' \/&gt;\r\n   &lt;h:inputText id='dogWeight' value='#{dogMB.dog.weight}' required='true' requiredMessage='#{msgs.dogWeightRequired}' &gt;\r\n    &lt;f:convertNumber \/&gt;\r\n   &lt;\/h:inputText&gt;\r\n  &lt;\/h:panelGrid&gt;\r\n  &lt;h:panelGrid columns='2'&gt;\r\n   &lt;h:commandButton action='#{dogMB.updateDogEnd()}' value='#{msgs.update}' \/&gt;\r\n   &lt;h:commandButton action='#{dogMB.listAllDogs()}' value='#{msgs.cancel}' immediate='true' \/&gt;\r\n  &lt;\/h:panelGrid&gt;\r\n  &lt;br\/&gt;\r\n &lt;\/h:form&gt;\r\n&lt;\/h:body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>About the code above:        <\/p>\n<ul>\n<li>Notice that in the line 15 the id is hidden. It is a necessary value if you use RequestScope instead SessionScope. I rather use RequestScope than SessionScope, your server memory will have less data in it.<\/li>\n<li>The  fields name and weight are required and will print an error message if you leave it empty.<\/li>\n<li>The cancel button needs the option immediate=\u201ctrue\u201d; with this option the JSF will not validate any field.<\/li>\n<\/ul>\n<div>\n<\/div>\n<p><strong>View \u2013 JBoss 7 JAAS Configuration<\/strong>       <\/p>\n<p>Now we need just a few more steps to finish our software (Finally!).        <\/p>\n<p>We need to edit the JBoss configurations and to add our JAAS configurations.        <\/p>\n<p>Open again the file \u201c<strong><em>YOUR_JBOSS\/standalone\/configuration\/standalone.xml<\/em><\/strong>\u201d and search for the key: \u201c&lt;security-domains&gt;\u201d. Add the code bellow (In this post I show how to do this set up for JBoss 6 \u2013 <a href=\"http:\/\/uaihebert.com\/?p=55\" title=\"User Login Validation with JAAS and JSF\">User Login Validation with JAAS and JSF<\/a>):        <\/p>\n<pre class=\"brush:xml\">&lt;subsystem xmlns='urn:jboss:domain:security:1.0'&gt;\r\n &lt;security-domains&gt;\r\n  &lt;!-- add me: begin --&gt;\r\n  &lt;security-domain name='CrudJSFRealm' cache-type='default'&gt;\r\n   &lt;authentication&gt;\r\n    &lt;login-module code='org.jboss.security.auth.spi.DatabaseServerLoginModule' flag='required'&gt;\r\n     &lt;module-option name='dsJndiName' value='CrudDS'\/&gt;\r\n     &lt;module-option name='principalsQuery' value='select password from users where email=?' \/&gt;\r\n     &lt;module-option name='rolesQuery' value='select role, 'Roles' from users u where u.email=?' \/&gt;\r\n    &lt;\/login-module&gt;\r\n   &lt;\/authentication&gt;\r\n  &lt;\/security-domain&gt;\r\n  &lt;!-- add me: end --&gt;\r\n\r\n  &lt;!-- Other data... --&gt;\r\n &lt;\/security-domains&gt;\r\n&lt;\/subsystem&gt;<\/pre>\n<p><strong>Running our Application<\/strong>       <\/p>\n<p>Let us create an EAR to unite our projects.        <\/p>\n<p>File &gt; New &gt; Other &gt;EnterpriseApplication Project<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/3.bp.blogspot.com\/-jqiggOTkarM\/T9-Cs0A8uhI\/AAAAAAAAAq8\/PaaeXOe-wWU\/s1600\/18-300x285.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/3.bp.blogspot.com\/-jqiggOTkarM\/T9-Cs0A8uhI\/AAAAAAAAAq8\/PaaeXOe-wWU\/s1600\/18-300x285.png\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/1.bp.blogspot.com\/-pbpIlhs0RAQ\/T9-C4oQuKQI\/AAAAAAAAArE\/I4GcqW2baxE\/s1600\/19-249x300.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/1.bp.blogspot.com\/-pbpIlhs0RAQ\/T9-C4oQuKQI\/AAAAAAAAArE\/I4GcqW2baxE\/s1600\/19-249x300.png\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/2.bp.blogspot.com\/-iZ60qvt-OVw\/T9-DEAK0yjI\/AAAAAAAAArM\/hr68tuAswJE\/s1600\/20-249x300.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/2.bp.blogspot.com\/-iZ60qvt-OVw\/T9-DEAK0yjI\/AAAAAAAAArM\/hr68tuAswJE\/s1600\/20-249x300.png\" \/><\/a><\/div>\n<p>We just need to have in our JBoss the EAR added.<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a href=\"http:\/\/1.bp.blogspot.com\/-4k6Rz5lGSqA\/T9-DNSN-JdI\/AAAAAAAAArU\/x7pT26khMHI\/s1600\/21-300x103.png\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/1.bp.blogspot.com\/-4k6Rz5lGSqA\/T9-DNSN-JdI\/AAAAAAAAArU\/x7pT26khMHI\/s1600\/21-300x103.png\" \/><\/a><\/div>\n<p>Let us run our application. Start the JBoss and access our application by the URL: <a href=\"http:\/\/localhost:8080\/CrudJSF\/\">http:\/\/localhost:8080\/CrudJSF\/<\/a>.        <\/p>\n<p>I wrote the pages with a simple CSS to make easier the understanding.        <\/p>\n<p>Login as USER and you will not see the update\/delete buttons; you will only see the Create button that we left there just to see an exception off illegal access.        <\/p>\n<p>Take a look bellow at our pages:        <\/p>\n<p>Logged as ADMIN:<\/p>\n<p><a href=\"http:\/\/uaihebert.com\/?attachment_id=988\" rel=\"attachment wp-att-988 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-988\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/22-150x150.png\" width=\"150\" \/><\/a><a href=\"http:\/\/uaihebert.com\/?attachment_id=967\" rel=\"attachment wp-att-967 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-967\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/23-150x150.png\" width=\"150\" \/><\/a><a href=\"http:\/\/uaihebert.com\/?attachment_id=968\" rel=\"attachment wp-att-968 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-968\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/24-150x150.png\" width=\"150\" \/><\/a><a href=\"http:\/\/uaihebert.com\/?attachment_id=969\" rel=\"attachment wp-att-969 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-969\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/25-150x150.png\" width=\"150\" \/><\/a><a href=\"http:\/\/uaihebert.com\/?attachment_id=970\" rel=\"attachment wp-att-970 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-970\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/26-150x150.png\" width=\"150\" \/><\/a><a href=\"http:\/\/uaihebert.com\/?attachment_id=971\" rel=\"attachment wp-att-971 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-971\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/27-150x150.png\" width=\"150\" \/><\/a><a href=\"http:\/\/uaihebert.com\/?attachment_id=972\" rel=\"attachment wp-att-972 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-972\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/28-150x150.png\" width=\"150\" \/><\/a><a href=\"http:\/\/uaihebert.com\/?attachment_id=973\" rel=\"attachment wp-att-973 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-973\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/29-150x150.png\" width=\"150\" \/><\/a><a href=\"http:\/\/uaihebert.com\/?attachment_id=974\" rel=\"attachment wp-att-974 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-974\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/30-150x150.png\" width=\"150\" \/><\/a><\/p>\n<p>Logged as USER:<\/p>\n<div style=\"text-align: -webkit-auto\"><a href=\"http:\/\/uaihebert.com\/?attachment_id=975\" rel=\"attachment wp-att-975 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-975\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/31-150x150.png\" width=\"150\" \/><\/a><a href=\"http:\/\/uaihebert.com\/?attachment_id=976\" rel=\"attachment wp-att-976 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-976\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/32-150x150.png\" width=\"150\" \/><\/a><a href=\"http:\/\/uaihebert.com\/?attachment_id=977\" rel=\"attachment wp-att-977 slb_group[834] slb slb_internal\"><img decoding=\"async\" alt=\"\" class=\"alignnone size-thumbnail wp-image-977\" height=\"150\" src=\"http:\/\/uaihebert.com\/wp-content\/uploads\/2012\/01\/33-150x150.png\" width=\"150\" \/><\/a><\/div>\n<p><b>That is all for today<\/strong><\/p>\n<p>To download the source code of this post, <a href=\"https:\/\/sites.google.com\/site\/uaihebertdeposito\/FullWebApplication.zip?attredirects=0\" title=\"Click here to download\">click here<\/a>.        <\/p>\n<p>I hope this post might help you.        <\/p>\n<p><em>If you have any doubt or comment just post it bellow.<\/em>       <\/p>\n<p>See you soon. \\o_        <\/p>\n<p><strong>Links that helped me:        <\/strong><\/p>\n<p><a href=\"http:\/\/7thursdays.wordpress.com\/2008\/03\/18\/dependency-injection-in-jboss-42-hold-your-excitement\/\">http:\/\/7thursdays.wordpress.com\/2008\/03\/18\/dependency-injection-in-jboss-42-hold-your-excitement\/<\/a>       <\/p>\n<p><a href=\"http:\/\/jan.zawodny.pl\/blog\/2011\/07\/jboss-7-postgresql-9\">http:\/\/jan.zawodny.pl\/blog\/2011\/07\/jboss-7-postgresql-9<\/a>       <\/p>\n<p><a href=\"http:\/\/blog.xebia.com\/2011\/07\/19\/developing-a-jpa-application-on-jboss-as-7\/\">http:\/\/blog.xebia.com\/2011\/07\/19\/developing-a-jpa-application-on-jboss-as-7\/<\/a>       <\/p>\n<p><a href=\"http:\/\/community.jboss.org\/wiki\/DataSourceConfigurationInAS7\">http:\/\/community.jboss.org\/wiki\/DataSourceConfigurationInAS7<\/a>       <\/p>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/286686\/how-to-create-conditions-based-on-user-role-using-jsf-myfaces\/\">http:\/\/stackoverflow.com\/questions\/286686\/how-to-create-conditions-based-on-user-role-using-jsf-myfaces\/<\/a>       <\/p>\n<p><a href=\"http:\/\/www.mkyong.com\/jsf2\/jsf-2-datatable-example\/\">http:\/\/www.mkyong.com\/jsf2\/jsf-2-datatable-example\/<\/a>                                   <\/p>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/uaihebert.com\/?p=834&amp;page=7\">Full WebApplication JSF EJB JPA JAAS<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Hebert Coelho at the <a href=\"http:\/\/uaihebert.com\/\">uaiHebert<\/a> blog.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>View \u2013 Creation and JSF set up This tutorial continues from part 1. Let us create a new Dynamic Web Project. Create it like the image bellow: Pay attention: in some moment the Eclipse will ask you if you want to add the JSF Capabilities (auto complete), enable it. Like the screens bellow: After the &hellip;<\/p>\n","protected":false},"author":154,"featured_media":174,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[90,296,33,293],"class_list":["post-1374","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-ejb","tag-jaas","tag-jpa","tag-jsf"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Full WebApplication JSF EJB JPA JAAS - Part 2 - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"View \u2013 Creation and JSF set up This tutorial continues from part 1. Let us create a new Dynamic Web Project. Create it like the image bellow: Pay\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Full WebApplication JSF EJB JPA JAAS - Part 2 - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"View \u2013 Creation and JSF set up This tutorial continues from part 1. Let us create a new Dynamic Web Project. Create it like the image bellow: Pay\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2012-06-19T01:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-22T05:33:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Hebert Coelho\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@http:\/\/twitter.com\/uaiHebert\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hebert Coelho\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"19 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html\"},\"author\":{\"name\":\"Hebert Coelho\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/997b72fad4d637a8d56a44ea7938ddf5\"},\"headline\":\"Full WebApplication JSF EJB JPA JAAS &#8211; Part 2\",\"datePublished\":\"2012-06-19T01:00:00+00:00\",\"dateModified\":\"2012-10-22T05:33:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html\"},\"wordCount\":1369,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"keywords\":[\"EJB\",\"JAAS\",\"JPA\",\"JSF\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html\",\"name\":\"Full WebApplication JSF EJB JPA JAAS - Part 2 - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"datePublished\":\"2012-06-19T01:00:00+00:00\",\"dateModified\":\"2012-10-22T05:33:19+00:00\",\"description\":\"View \u2013 Creation and JSF set up This tutorial continues from part 1. Let us create a new Dynamic Web Project. Create it like the image bellow: Pay\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/jsf-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2012\\\/06\\\/full-webapplication-jsf-ejb-jpa-jaas_19.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Full WebApplication JSF EJB JPA JAAS &#8211; Part 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/997b72fad4d637a8d56a44ea7938ddf5\",\"name\":\"Hebert Coelho\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g\",\"caption\":\"Hebert Coelho\"},\"description\":\"Senior Java Development, with 4 certifications and a published book about JSF (portuguese only). Founder of the blog uaiHebert.com visited from more than 170 different countries.\",\"sameAs\":[\"http:\\\/\\\/uaihebert.com\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/pub\\\/h%C3%A9bert-coelho-de-oliveira\\\/46\\\/ba8\\\/5bb\",\"https:\\\/\\\/x.com\\\/http:\\\/\\\/twitter.com\\\/uaiHebert\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Hebert-Coelho\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Full WebApplication JSF EJB JPA JAAS - Part 2 - Java Code Geeks","description":"View \u2013 Creation and JSF set up This tutorial continues from part 1. Let us create a new Dynamic Web Project. Create it like the image bellow: Pay","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html","og_locale":"en_US","og_type":"article","og_title":"Full WebApplication JSF EJB JPA JAAS - Part 2 - Java Code Geeks","og_description":"View \u2013 Creation and JSF set up This tutorial continues from part 1. Let us create a new Dynamic Web Project. Create it like the image bellow: Pay","og_url":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2012-06-19T01:00:00+00:00","article_modified_time":"2012-10-22T05:33:19+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","type":"image\/jpeg"}],"author":"Hebert Coelho","twitter_card":"summary_large_image","twitter_creator":"@http:\/\/twitter.com\/uaiHebert","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Hebert Coelho","Est. reading time":"19 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html"},"author":{"name":"Hebert Coelho","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/997b72fad4d637a8d56a44ea7938ddf5"},"headline":"Full WebApplication JSF EJB JPA JAAS &#8211; Part 2","datePublished":"2012-06-19T01:00:00+00:00","dateModified":"2012-10-22T05:33:19+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html"},"wordCount":1369,"commentCount":4,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","keywords":["EJB","JAAS","JPA","JSF"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html","url":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html","name":"Full WebApplication JSF EJB JPA JAAS - Part 2 - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","datePublished":"2012-06-19T01:00:00+00:00","dateModified":"2012-10-22T05:33:19+00:00","description":"View \u2013 Creation and JSF set up This tutorial continues from part 1. Let us create a new Dynamic Web Project. Create it like the image bellow: Pay","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/jsf-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2012\/06\/full-webapplication-jsf-ejb-jpa-jaas_19.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Full WebApplication JSF EJB JPA JAAS &#8211; Part 2"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/997b72fad4d637a8d56a44ea7938ddf5","name":"Hebert Coelho","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/afcc9fe43ded824615eb04ed102590ff0c8601a47624b2a681103f05da1bddfb?s=96&d=mm&r=g","caption":"Hebert Coelho"},"description":"Senior Java Development, with 4 certifications and a published book about JSF (portuguese only). Founder of the blog uaiHebert.com visited from more than 170 different countries.","sameAs":["http:\/\/uaihebert.com\/","http:\/\/www.linkedin.com\/pub\/h%C3%A9bert-coelho-de-oliveira\/46\/ba8\/5bb","https:\/\/x.com\/http:\/\/twitter.com\/uaiHebert"],"url":"https:\/\/www.javacodegeeks.com\/author\/Hebert-Coelho"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/154"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=1374"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/1374\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/174"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=1374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=1374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=1374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}