permaculture playing cards*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 60794
    
  65

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: 60794
    
  65

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Strange behaviour of jsp:include
 
Similar Threads
Struts1.3 tiles problem
jsp include nested in a foreach loop makes me crazy
Regarding Request Parameter Passing
New Session Created Randomly in Tomcat 5.0.28
jsp:include problem