JavaServer Page

March 10, 2007

CHAPTER 9 Posing conditions with tags in testing

Filed under: JSP Tag Libraries — webmaster @ 4:06 pm

CHAPTER 9 Posing conditions with tags in testing a boolean value; the conditions we use are eq true and eq false, meaning equals true and equals false. We are not doing a simple if-else (we actually can t), but instead are asking about two negatives. Listing 9.8 Using the conditional tags with a boolean value < % Boolean b = new Boolean(true); %> TRUE FALSE You may wonder about the fact that in listing 9.8 we generated our object in a scriptlet (about the easiest way to pass a value to the tag), but don t let it concern you. We could get this value from anywhere in the JSP environment (e.g., we could get this value from a bean) and our tag would work equally well. Another sample JSP fragment shows a more complex scenario in which the developer grabs the User-Agent header and checks to see what type of client is being served. Listing 9.9 A complex usage of the conditional tags d Yes No
e You are probably using some Windows98 variation.
f What’s that? No Mozilla?

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Tomcat Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Java Web Hosting