Two Laptop Bag*
The moose likes JSP and the fly likes Strange behaviour of jsp:include Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Strange behaviour of jsp:include" Watch "Strange behaviour of jsp:include" New topic
Author

Strange behaviour of jsp:include

Sangeetha Rao
Ranch Hand

Joined: Aug 01, 2005
Posts: 33
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

Joined: Jan 10, 2002
Posts: 61092
    
  66

Windows, unlike sane operating systems, is case-insensitive.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sangeetha Rao
Ranch Hand

Joined: Aug 01, 2005
Posts: 33
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

Joined: Jan 10, 2002
Posts: 61092
    
  66

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Strange behaviour of jsp:include