How to populate options of h:selectOneMenu from database? JAVA JSF

The Project Structure in netbeans is shown Mysql Table Structure CREATE TABLE `categories` ( `sl_no` INT(11) NOT NULL AUTO_INCREMENT, `category_name` VARCHAR(50) NOT NULL DEFAULT ‘0’, PRIMARY KEY (`sl_no`) ) MySql Table Data index.xhtml <?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://xmlns.jcp.org/jsf/html” xmlns:f=”http://xmlns.jcp.org/jsf/core”> <h:head> <title>Facelet Title</title> </h:head> <h:body> <h:form> …

Continue reading

Create WhatsApp Share Button on WebSites

This tutorial shows how to create WhatsApp share button on WebPages, This example is with HTML and will work of JAVA, JSP, PHP and any HTML Support Platforms. 1. Just add the below source code in your Webpage to create a share link. You can put image also inside the href Link with a Whatsapp …

Continue reading

Run-Command-Prompt-CMD-commands-from-JAVA

This tutorial shows how to Execute Command Prompt Commands from JAVA, Copy the below two classes to same package cmd_prompt Now run the my_main.java as Run as Java Application 1. my_main.java 2. SyncPipe.java 1. my_main.java package cmd_prompt; import java.io.PrintWriter; public class my_main { public static void main(String[] args) { String[] command = { “cmd”, }; …

Continue reading