File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

page directive import attribute

 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
khushhal yadav
Ranch Hand
Posts: 242
Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for additional details, now I fix these things into my brain.

 
Cristiano Sganzerla
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you think this kind of question can appear on the exam ?

I dont think so !!!
 
naresh govindaswmay
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....
 
Padma priya Gururajan
Ranch Hand
Posts: 437
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 242
Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic