1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | package com.clarity; ... @ManagedBean() @SessionScoped public class Places { private ArrayList<lace> places = null; ... private static SelectItem[] zoomLevelItems = { ... public String logout() { FacesContext fc = FacesContext.getCurrentInstance(); ELResolver elResolver = fc.getApplication().getELResolver(); User user = (User)elResolver.getValue( fc.getELContext(), null, "user"); user.setName(""); user.setPassword(""); setPlacesList(null); return "login"; } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 | <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"> <div class="placesSearchForm"> <div class="placesSearchFormHeading"> #{msgs.findAPlace} </div> <ui:include src="addressForm.xhtml"> <ui:include src="logoutIcon.xhtml"> </div> </ui:composition> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"> <h:form prependId="false"> <h:panelGrid columns="2"> #{msgs.streetAddress} <h:inputText value="#{place.streetAddress}" size="15"/> #{msgs.city} <h:inputText value="#{place.city}" size="10"/> #{msgs.state} <h:inputText value="#{place.state}" size="3"/> #{msgs.zip} <h:inputText value="#{place.zip}" size="5"/> <h:commandButton value="#{msgs.goButtonText}" style="font-familyalatino;font-style:italic" action="#{place.fetch}"/> </h:panelGrid> </h:form> </ui:composition> |
1 2 3 4 5 6 7 8 9 | <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:util="http://java.sun.com/jsf/composite/components/util"> <util:icon image="#{resource['images:back.jpg']}" actionMethod="#{places.logout}" style="border: thin solid lightBlue"/> </ui:composition> |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |