• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

tag question.

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are using a tag library with prefix "generator", which supports a tag named "random". This tag generates a random number and sets it to a variable named "value". Which of the following will output this value in the page?


Select 1 correct option.
a <generator:random>value</generator:random>


b <generator:random><%=value%></generator:random>


c <generator:random><% int value;%> <%=value%></generator:random>
It'll give an exception saying value is not initialized!

d <generator:random><%getParameter("value")%></generator:random>


e None of the above.

hey guys, can uhelp me out wd this Qn..
the ans is b..why???/
 
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no default body-content for simple/classic tags.
But if JSP were to be specified as body-content then the expression
<%=value%> would work.

You need to read up on "Variable Synchronization" topic from JSP specs to understand how the output of the custom tag works.

Regards,
Shivani
 
No, tomorrow we rule the world! With this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic