Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strange behaviour of jsp:include

 
Sangeetha Rao
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two of the pages in my application are called "login.jsp" and "confirm.jsp".

confirm.jsp has this line in it.



only if init-caps is given to the file name of login.jsp on Windows, it works fine. When I give the correct filename of login.jsp (without init-caps), I get this exception:
java.lang.NoClassDefFoundError: org/apache/jsp/login_jsp (wrong name: org/apache/jsp/Login_jsp)


But on Linux, it works fine only if the correct case is given. Why is this strange behaviour on Windows?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Windows, unlike sane operating systems, is case-insensitive.
 
Sangeetha Rao
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand that Windows is case-insensitive. It means that you can give either upper case or lower case in a file name and it is sure to fetch the same file. But in my case, when I give lower case (the actual file name is with lower case) it doesnt work but if I give upper case it works!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks as if a discrepency was introduced when the class file was created from the JSP's servlet. Be sure to always use the correct case when referencing files even if using Windows.

I'd remove all work files and make sure that the first time that you "hit" the JSP, you use the correct casing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic