MysorePak Posted March 12, 2015 Report Posted March 12, 2015 How i can get request header parameter details while the page is trying to load... okka page lo 5 'comments' button vunnayi to add comment for each difference place in a tab ki... so once we add the comment to that particular tab next time while loading it should show as 'comment(1)' as button name.. which has comment already.. so aa comments ani db lo store chesthunamu and okka reqid dwara pull chesthunamu... i can get reqid but adhi click chesi nappudu vasthundhi.. page load ayyitappudu ela tesukoni ravali aa req id ne .. ekkada parameters only click on button chesinappudu vasthundhi not at loading the page... parameters = FacesContext.getCurrentInstance().getExternalContext(). getRequestParameterMap();
ZuniorVentiyar Posted March 12, 2015 Report Posted March 12, 2015 this is in u r ManagedBean Map<string,String> headerMap = FacesContext.getCurrentInstance().getExternalContext(). getRequestParameterMap(); //add a simple method to get values from Map public static Object getValuefromMap(Map map, Object key) { return map.get(key); } inside your XHTML use this #{fn:getMapValue(bean.headerMap , 'key')} don't foget to add JSTL reference to u r XHTML page - http://java.sun.com/jsp/jstl/functions
MysorePak Posted March 12, 2015 Author Report Posted March 12, 2015 bhayya i am geeting header map and key when i click on the comment button.... page load ayyitappudu ravadam ledhu.. i want to get map values at the time of page load this is in u r ManagedBean Map<string,String> headerMap = FacesContext.getCurrentInstance().getExternalContext(). getRequestParameterMap(); //add a simple method to get values from Map public static Object getValuefromMap(Map map, Object key) { return map.get(key); } inside your XHTML use this #{fn:getMapValue(bean.headerMap , 'key')} don't foget to add JSTL reference to u r XHTML page - http://java.sun.com/jsp/jstl/functions
ZuniorVentiyar Posted March 12, 2015 Report Posted March 12, 2015 page load lo ravali anteee .. nee managed bean construtor lo ee code pettu in managed bean declare Map<string,String> headerMap ; in constructor add thsi .... headerMap = FacesContext.getCurrentInstance().getExternalContext(). getRequestParameterMap(); bhayya i am geeting header map and key when i click on the comment button.... page load ayyitappudu ravadam ledhu.. i want to get map values at the time of page load
Recommended Posts