Jump to content

Calling...super_Man On Java Doubt


Recommended Posts

Posted

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();
Posted
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
 
Posted

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

 

 

Posted

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

 

×
×
  • Create New...