File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes mockQuestion from javabeat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "mockQuestion from javabeat" Watch "mockQuestion from javabeat" New topic

mockQuestion from javabeat

geeta vemula
Ranch Hand

Joined: Jul 18, 2008
Posts: 208
Which of the following statements are correct regarding the import tag of JSTL?

Select 2 correct options.

A.The String value of the imported content can be made available for use outside of the tag in 'var' variable.
B.If the url contains a relative path, then the resource must exist in the same webapp.
C.import tag is more efficient than jsp:include action in the case when large amount of data is imported only to be given to another tag.
D.import tag is useful to convert URL when cookies are not supported by the client.
E.The content imported by the import tag can be made available only through a String object


Here how option A is correct? var attribute is available with <c:url.. but not with ><c:import url="someUrl"/>

and also I am not able to get option C, <c:import..> is better that <jsp:include..> in the sense that it may reach out of the web application

Can anyone clear my doubt about this?
Venkata Kumar
Ranch Hand

Joined: Apr 16, 2008
Posts: 110

Hi Geeta,

var attribute is available for <c:import>. Using var attribute you can store the string content of URL and use it somewhere else in the jsp.
for ex:
is same as

see the jstl spec
Using c:import we can store large amount of data(data in url) in var attribute and this can be used in another tag as shown in above code.


SCJP 5.0, SCWCD 5, preparing for SCDJWS
I agree. Here's the link:
subject: mockQuestion from javabeat
It's not a secret anymore!