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 JSPs and package statements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSPs and package statements" Watch "JSPs and package statements" New topic
Author

JSPs and package statements

John Wetherbie
Rancher

Joined: Apr 05, 2000
Posts: 1441
Hi, all!
Is there any way to put a package statement in a JSP as in a regular Java class?

If so, is there any reason to do this?


The only reason for time is so that everything doesn't happen all at once.
- Buckaroo Banzai
Michael Zalewski
Ranch Hand

Joined: Apr 23, 2002
Posts: 168
I don't think it makes sense to do this. Your application server will map each .jsp to a specific servlet. If you changed the package, you would change the location of the .class file for this servlet, so the application server would probably not be able to find the servlet class.
But you can do this:

Then you could have


But, this procedure will likely tie you down to your particular JSP page compiler.
But instead of doing this, I would be tempted to do the following: Get rid of all scriptlets in your JSP pages, and replace them with TagLibs. You can then put the .java source into any package you want.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSPs and package statements
 
Similar Threads
import javax.servlet.*;
java classes accessiblity
Problem viewing applet in Firefox 2 on Ubuntu Linux
using weblogic servigen ant task
can we create object of the interface and what is the base package of java ?