Criando uma lista na sessão com DWR – Parte 2
Dando continuidade…..
Vimos no artigo anterior a parte teórica deste artigo, agora vamos dar início a parte mais divertida: código ;D
Criando o Bean
Para iniciarmos o nosso exemplo sem mais delongas vamos criar o bean que iremos utilizar. Veja a listagem 01
public class BeanSession { private String id; private String keyMap; private String name; public String getId() { return id; } public String getKeyMap() { return keyMap; } public String getName() { return name; } public void setId(String id) { this.id = id; } public void setKeyMap(String keyMap) { this.keyMap = keyMap; } public void setName(String name) { this.name = name; } }
Listagem 01: Código do BeanSession com 3 propriedades(id, keyMap e name) e seus respectivos Get´s e Set´s.
Iremos utilizar esse bean para auxiliar o transporte dos dados entre o Java e o JavaScript. Mas o uso do mesmo não é obrigatório como vocês já sabem. No meu modelo eu utilizo Bean´s, mas caso você esteja utilizando outra forma também é possível, tanto com objetos JSON, Parâmetros como Integer, String etc, são aceitos com tranqüilidade pelo DWR.
Alterando o FacadeAjaxSession.java
Segue o código que tínhamos:
public class FacadeAjaxSession { public String exampleSession1(String attribute){ WebContext wc = WebContextFactory.get(); String valueSession = ""; if(wc.getHttpServletRequest().getSession().getAttribute(attribute)!= null){ valueSession = wc.getHttpServletRequest().getSession().getAttribute(attribute).toString(); }else{ valueSession = "Session is null"; } return valueSession; } public void createSession(String attribute, String value){ WebContext wc = WebContextFactory.get(); wc.getHttpServletRequest().getSession().setAttribute(attribute, value); } public String exampleSession2(String attribute){ Session session = new SessionFacade(); String valueSession = ""; if(session.getAttribute(attribute)!= null){ valueSession = session.getAttribute(attribute).toString(); }else{ valueSession = "Session is null"; } return valueSession; } }
Listagem 02: Código do FacadeAjaxSession que utilizamos no último artigo.
Por hoje é só, na parte 3 deste artigo vamos ver o restante da classe FacadeAjaxSession.
Abraços
yasmin discount pharmacy
yasmin price nz
trental 400 mg cost
where to buy synthroid 1mg in canada
order plavix online
singulair prescription cost
can you buy plaquenil in mexico
plavix medication
synthroid 30 mg
quineprox 800 mg
diltiazem 180mg over the counter diltiazem medication zyloprim 300mg pill
yasmin birth control pills
robaxin 1700mg
tetracycline cost canada
buy metoprolol pill medrol 8mg without prescription buy generic medrol
https://whyride.info/ – whyride
purchase tetracycline
prescription singulair
“Once you plant that cock of yours in some squirmy hole and empty those warm balls of yours into a moist wet hole. Then you are on your way to becoming a man, and only then will you, come-of-age. But it is only a step onto the winding pathway towards manhood. It is my job to teach you what it means to be a man.” His father stands as he finishes his sentence. Loosening his belt and pulling his shirt out from the tucked confines of his pants. He runs the towel through his curl-filled hair, and down over his chest, where the early signs of his manhood sprout like an uneven crop of hairs across his chest that run down to his furry-pillowed crotch. Where the throbbing from his hard-on springs back as the damp towel whips his erection back and forth with each swipe of the now dampened towel.
“What did Coach have to say when he saw all those hard-young cocks in the locker room?” His dad asks. “Coach told us. To go beat off. Seeing all those tents in our shorts; he said we should have all been working out naked. Our shorts weren’t covering up, anything, as our cock’s periscoped out and over the elastic waistbands of our shorts.” He says to his dad as he steps from the shower.