File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes importing java class files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "importing java class files" Watch "importing java class files" New topic
Author

importing java class files

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
I have this statement in a jsp file
<%@ page import="java.util.*" %>

and I am only able to access the File class by using the following syntax
java.io.File
Where an I going wrong?
Thanks david
Padmaja Godbole
Greenhorn

Joined: May 10, 2003
Posts: 14
To make use of File class without fully specified class name import java.io.* also.
[ July 08, 2003: Message edited by: Padmaja Godbole ]

Padmaja Godbole<br />---------------------<br />SCJP2
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67

Why did you think that importing java.util would also pick up java.io?
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Manish Sharma
Greenhorn

Joined: Apr 11, 2003
Posts: 10
Hi
I don't thing there any problem in this statement. Anyway try to use this
<%@ page language="java" %>
<%@ page import="java.util.*" %>
or can you send your JSP file ?

waiting for reply
with regards
Manish

Originally posted by david allen:
I have this statement in a jsp file
<%@ page import="java.util.*" %>

and I am only able to access the File class by using the following syntax
java.io.File
Where an I going wrong?
Thanks david
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61434
    
  67


I don't thing [sic] there any problem in this statement.

While there's no problem, there's no way it is going to import the io package either. For that

is needed.
bear
[ July 09, 2003: Message edited by: Bear Bibeault ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: importing java class files