Skip to content

Instantly share code, notes, and snippets.

View Guvenir's full-sized avatar
😊
Focusing

Ömer Güvenir Guvenir

😊
Focusing
View GitHub Profile
@Guvenir
Guvenir / web.xml
Created January 22, 2015 18:25
web filter
<filter>
<filter-name>AuthFilter</filter-name>
<filter-class>com.util.AuthFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>AuthFilter</filter-name>
<url-pattern>/anasayfa.xhtml</url-pattern>
</filter-mapping>
package com.util;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
public class Util {
public static HttpSession getSession() {
return (HttpSession) FacesContext.
@Guvenir
Guvenir / faces-config.xml
Last active August 29, 2015 14:20
internationalization
<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.1"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd">
<application>
<locale-config>
<default-locale>tr</default-locale>
<supported-locale>en</supported-locale>
</locale-config>
@Guvenir
Guvenir / index.xhtml
Created April 29, 2015 08:10
internationalization
<?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:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>JSF tutorial</title>
</h:head>
@Guvenir
Guvenir / NewJSFManagedBean.java
Last active August 29, 2015 14:20
internationalization
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.Map;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
/**
@Guvenir
Guvenir / welcome_tr.properties
Last active August 29, 2015 14:20
internationalization
mesaj=Merhaba Dünya!
buton=Giriş
@Guvenir
Guvenir / welcome_en.properties
Created April 29, 2015 08:14
internationalization
mesaj=Hello World!
buton=Login
@Guvenir
Guvenir / anasayfam.xhtml
Created July 5, 2015 09:29
JSF ui:include kullanımı
<?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:ui="http://xmlns.jcp.org/jsf/facelets">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<h:form>
@Guvenir
Guvenir / menubar.xhtml
Created July 5, 2015 09:30
Jsf ui:composition kullanımı
<?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:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
<title>Facelet Title</title>
</h:head>
@Guvenir
Guvenir / jsf.xhtml
Created July 5, 2015 09:32
h:outputStylesheet ve h:graphicImage kullanımı
<h:outputStylesheet library="awesome" name="/css/font-awesome.css"/>
<h:graphicImage library="images" name="resim.png" width="100"/>