HI Magnus,

Make use of the simple datatype 'boolean' instead of the object 'Boolean'

boolean BoolDans = false;
boolean BoolAllman = false;
boolean BoolFof = false;
boolean BoolTextil = false;
boolean BoolHp = false;

if (request.getParameter("IntresseDans") != null) {
        BoolDans = true;
}
....etc

There is simple datatypes for Interger (int), Long (long),...etc.

Check the Java basics book for more info.

Best regards

Joacim J�rkeborn
Consultant - Systems Development 
Cell Network Sverige AB
__________________________________________________
Volvo IT
Dept 9224, ARH4
Gothenburg, Sweden

Telephone..: +46 31 765 49 65
Mobilephone: +46 708 78 58 01
E-mail.....: [EMAIL PROTECTED]
__________________________________________________ 

> -----Original Message-----
> From: Magnus Jansson [mailto:[EMAIL PROTECTED]]
> Sent: den 17 september 2001 09:25
> To: [EMAIL PROTECTED]
> Subject: Is this the way to do it?
> 
> 
> Hi I'm a newbie at both jsp and java. My question is:
> 
> Is this the way to set a (in this case) a Boolean value? This 
> seems for me who is a Pascal programmer as I create a new 
> instance of the Boolean object everytime I set a new value?
> 
> Besides it is a lot of code to write? Can I set the value of 
> the boolean in any other way????????
> 
> I have the same problem in the other objects of the primitive 
> types (Integer for example)
> 
> <snip>  
> 
>   Boolean BoolDans = new Boolean(false);
>   Boolean BoolAllman = new Boolean(false);
>   Boolean BoolFof = new Boolean(false);
>   Boolean BoolTextil = new Boolean(false);
>   Boolean BoolHp = new Boolean(false);
>   
>   if (request.getParameter("IntresseDans") != null) {BoolDans 
> = new Boolean(true);};
>   if (request.getParameter("IntresseAllman") != null) 
> {BoolAllman = new Boolean(true);};
>   if (request.getParameter("IntresseFof") != null) {BoolFof = 
> new Boolean(true);};
>   if (request.getParameter("IntresseTextil") != null) 
> {BoolTextil = new Boolean(true);};
>   if (request.getParameter("IntresseHp") != null) {BoolHp = 
> new Boolean(true);};
> 
> </snip>
> 
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> - - - - - - - - - - - - - - 
> Magnus Jansson
> IT-Manager
> V�dd� folkh�gskola
> 760 40 V�dd�
> Sweden
> 
> Phone: +46 (0) 176-528 00
> Cellular: +46 (0) 70-370 33 16
> Fax: +46 (0) 176-528 28
> http://www.vaddo.fhsk.se (work)
> http://www.jason.pp.se (private)
> ICQ: 52797837
> 
> 

Reply via email to