Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

packageless classes and jsp

 
JohnWilliam Fitz
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • 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()); %>
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, packageless classes (default package) will cause you problems.
Don't use them... :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic