• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

packageless classes and jsp

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

If I make a little packageless class and put it directly in WEB-INF classes, I seem to be unable to call it from jsp. Is there something that prevents jsp's from using packageless classes (or should I say classes in the default package)? (Below is an example.)

//my packageless class
public class P284 {
public static String hi() {
return "hi";
}
}


<!-- my jsp -->
<% out.println(P284.hi()); %>

/* <!-- ERROR IN BROWSER...
An error occurred at line: 1 in the jsp file: /p284.jsp
P284 cannot be resolved
1: <% out.println(P284.hi()); %>
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, packageless classes (default package) will cause you problems.
Don't use them... :-)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic