How to handle authentication/authorization with users in a database?

There are several options. Which to choose is fully up to you. Just objectively weigh the concrete advantages and disadvantages conform your own situation. 1. Use Java EE provided container managed authentication Just declare a <security-constraint> in web.xml which refers a security realm which is configured in servletcontainer. You can for your webapp specify URL … Read more

Ajax update doesn’t work, when using filter on p:dataTable

After updating datatable you have to invoke it’s client side filter() method. <p:dataTable widgetVar=”dataTableWidgetVar” id=”dataTable” var=”row” value=”#{bean.value}” filteredValue=”#{bean.filteredValue}” paginator=”true” rows=”25″ paginatorPosition=”bottom” rowKey=”${row.id}” editable=”true”> <p:commandButton value=”Save” actionListener=”#{bean.save}” update=”:form” oncomplete=”PF(‘dataTableWidgetVar’).filter()”/> For PrimeFaces versions older than 5, you should use <p:commandButton value=”Save” actionListener=”#{bean.save}” update=”:form” oncomplete=”dataTableWidgetVar.filter()”/>

Spawning threads in a JSF managed bean for scheduled tasks using a timer

Introduction As to spawning a thread from inside a JSF managed bean, it would only make sense if you want to be able to reference it in your views by #{managedBeanName} or in other managed beans by @ManagedProperty(“#{managedBeanName}”). You should only make sure that you implement @PreDestroy to ensure that all those threads are shut … Read more

JSF — over a java.util.Set?

The easiest way to finish the deal at page without modifying the class is converting the set to an array like this. <ui:repeat value=”#{myBean.mySet.toArray()}” var=”_myvar”>

Java EE vs JSP vs JSF [closed]

Is JSP “dead” in favor of JSF? JSF has countless benefits over JSP. For instance: It defines a MVC approach It set up componentization standards It has apply values feature Built-in AJAX A defined view context control Allows for rich interfaces extensions like Primefaces And we can go on and on. You can still use … Read more

How to trigger component refresh from javascript in primefaces?

You can use PrimeFaces’ <p:remoteCommand> for this. <p:remoteCommand name=”updateGrowl” update=”showmessage” /> which is to be invoked as <p:commandButton … oncomplete=”addMemberDlg.hide(); updateGrowl();” /> In this particular case there’s however a simpler way. Set the autoUpdate attribute of <p:growl> to true. <p:growl autoUpdate=”true” life=”1500″ id=”showmessage”/> It’ll auto-update itself on every ajax request. If your component actually didn’t … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)