• Post Reply Bookmark Topic Watch Topic
  • New Topic

package question in JSP

 
Arul Jose
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


in the JSP page given above why do we have to specify the packages both in the import in the page directive and the class in the jsp:useBean tag?

jose.
 
Jherald Lacambra
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It has to be that way so that java machine can choose where it can get the method you are calling.

For example, if you have the same method name but in different name, the jvm will be confuse on which method you are calling if the 2 classes belong to same package, so you will have to declare it again in the usebean

Hope this helps. :roll: :roll: :roll:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!