File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes page directive import attribute 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 "page directive import attribute" Watch "page directive import attribute" New topic
Author

page directive import attribute

Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi,



It is correct page directive. It is tested. At first it looked bizarre to me.
Apart from this it was not one of the correct answers of the question.

Source of doubt: Enthu

Thanks,


cmbhatt
khushhal yadav
Ranch Hand

Joined: Jun 20, 2007
Posts: 242

Hi Chandra

<%@ page import="java.util.*" import="java.text.*"%>


is a valid option.

Not only this but
<%@ page import="java.util.*" import='java.io.*' autoFlush="true" autoFlush="true" buffer='8kb' buffer="8kb"%>


is also valid.

The only thing that is not valid more than one declaration of pageEncoding attribute even with identical value.i.e.
<%@ page pageEncoding="ISO-8859-1" pageEncoding="ISO-8859-1"%>

Regards,
Khushhal


rgrds,
Khushhal
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Thanks for additional details, now I fix these things into my brain.

Cristiano Sganzerla
Ranch Hand

Joined: Jan 14, 2006
Posts: 44
Do you think this kind of question can appear on the exam ?

I dont think so !!!


SCJP 1.4 - SCWCD 1.4
naresh govindaswmay
Ranch Hand

Joined: Aug 15, 2007
Posts: 90
hi,
I am not able to get it what you are saying.whether we can have a unique attribute in the page directive or not....


Thanks and Regards<br />Naresh govindaswamy
Padma priya Gururajan
Ranch Hand

Joined: Oct 05, 2006
Posts: 434
Hi,
You can have any number of import attributes and pageEncoding attributes within the page directives. There is no restriction.
With regards,
Padma priya N.G.


Padma priya N.G.
Be the change you want to be - Mahatma Gandhi
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

That's weird. It's the first time I see a directive with the same attribute set more than once. Is this allowed ?
I was looking at the EBNF grammar for the JSP syntax in the spec, and it appears that no attribute can be repeated more than once.
For example, import values are serated by commas.




khushhal, why do you think it is valid ? (please don't tell me it's because it works with Tomcat )
padmapriyagururajan : same question
[ August 17, 2007: Message edited by: Christophe Verre ]

[My Blog]
All roads lead to JavaRanch
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Ok, maybe it has something to do with the following notation for directives :
<%@ directive { attr=�value� }* %>

I don't if this is EBNF, but if it were, curly brackets are used to indicate that the content can be repeated.
So that would explain why attributes can be repeated within directives.

Well, I'm never going to use that anyway
khushhal yadav
Ranch Hand

Joined: Jun 20, 2007
Posts: 242

Hi Christophe

Ok, maybe it has something to do with the following notation for directives :
<%@ directive { attr=�value� }* %>


You are already having the answer with you.
I also got it sure from one of the Mailing list archives
(noted by Craig R. McClanahan, lead of open source struts framework)

Yes, it's one of the wierd thing. But it's how it works.
And yes, I am using Tomcat and it works on Tomcat


Regards,
Khushhal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: page directive import attribute