JSF XHTML URL parametre alma kodu kullanımı örneği (JSF XHTML get URL parameter code usage example)

FacesContext facesContext = FacesContext.getCurrentInstance();

    public String getStrParam(String paramName){		
		String result = null;
		if(facesContext.getExternalContext().getRequestParameterMap().get(paramName) != null){
			result = facesContext.getExternalContext().getRequestParameterMap().get(paramName);
		}
		
		return result;
	}
    
	public int getIntParam(String paramName){		
		int result = 0;
		if(facesContext.getExternalContext().getRequestParameterMap().get(paramName) != null){
			result = Integer.parseInt(facesContext.getExternalContext().getRequestParameterMap().get(paramName));
		}
		
		return result;
	}
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on StumbleUpon0Share on Reddit0

Leave a Reply


*