Web Development with Java



Download 1,94 Mb.
Pdf ko'rish
bet76/82
Sana14.07.2022
Hajmi1,94 Mb.
#797363
1   ...   72   73   74   75   76   77   78   79   ...   82
Bog'liq
Web Development With Java

package
shared;
import
java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public
@
interface
ButtonMethod {
String buttonName() 
default
“”;
boolean
isDefault() 
default
false;
}
Listing A.1
The 
ButtonMethod
annotation.
SetByAttribute
Listing A.2 is the 
SetByAttribute
annotation. Place the annotation before the 
accessor of a bean property that is associated with a form element that is a button 
group or a select list. These types of form elements are initialised by including an 
extra attribute in the element. The type of the additional attribute is defi ned in 
the 
AttributeType
parameter of the annotation.
package
shared;
import
java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public
@
interface
SetByAttribute {
AttributeType type();
}
Listing A.2
The 
SetByAttribute
annotation.
A.4.2 Cookie 
Utility
The cookies that are retrieved in a servlet cannot be accessed randomly; it is nec-
essary to do a linear search each time a cookie is needed. To facilitate this task, a 


Appendix 
259
utility class of static methods was created that will perform such linear searches. 
A cookie can be retrieved by name; either the cookie or the cookie’s value can be 
returned (Listing A.3).
package
shared;
import
javax.servlet.http.Cookie;
import
javax.servlet.http.HttpServletRequest;
public class
CookieUtil {
static

Download 1,94 Mb.

Do'stlaringiz bilan baham:
1   ...   72   73   74   75   76   77   78   79   ...   82




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish