code-not-found / jsf-primefaces Goto Github PK
View Code? Open in Web Editor NEWJSF Primefaces Tutorials
Home Page: https://codenotfound.com/jsf-primefaces-tutorials
License: MIT License
JSF Primefaces Tutorials
Home Page: https://codenotfound.com/jsf-primefaces-tutorials
License: MIT License
I am creating same project as yours but JSF @PostConstruct method is not calling...
Managed Bean:
@Named
@ViewScoped
public class CustomerBean implements Serializable {
private static final long serialVersionUID = 1L;
@Autowired
private CustomerRepository customerRepo;
private List<Customer> customer;
public List<Customer> getCustomer() {
return customer;
}
@PostConstruct
public void init() {
System.out.println("Calledd");
customer = customerRepo.findAll();
}
Controller:
@Controller
@RequestMapping("/Customer")
public class CustomerController {
@GetMapping("/data")
public String getData(Model model){
return "Customer";
}
Xhtml File :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>DataTable Example</title>
</h:head>
<h:body>
<p:dataTable var="customer" value="#{CustomerBean.customer}">
<p:column headerText="Id">
<h:outputText value="customer.id" />
</p:column>
<p:column headerText="Name">
<h:outputText value="#{customer.name}" />
</p:column>
<p:column headerText="Address">
<h:outputText value="#{customer.address}" />
</p:column>
<p:column headerText="Email">
<h:outputText value="#{customer.email}" />
</p:column>
<p:column headerText="Mobile">
<h:outputText value="#{customer.mobile}" />
</p:column>
</p:dataTable>
</h:body>
</html>
Can you please tell me why i am getting too many redirect issue?
As i tested your code but its not working so i implemented same in my application but its giving issue "Too Many Rediretcs"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.