aspose 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
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: 1449
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