Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP and Web.xml  RSS feed

 
yash Vi
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very silly question.Dont we need Deployment descriptor(web.xml) for JSP files.I have just created an test\Web-INI folder and the folder is empty.I am able to vies the JSP pages in the test folder.Why dont we need web.xml for JSP pages.??
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36406
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yash,
Welcome to JavaRanch!

When you refer to a JSP by its relative path, the container knows where to find it. For example, "/jsp/HelloWorld.jsp". When you want to refer to it by an alias like "/Hello", you need to define this in the web.xml.

For apps that are getting deployed somewhere, you will want to use the aliases so clients are not dependent (or knowledgeable) of the real file names.
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yash, the directory you created was WEB-INF and not WEB-INI, right!
[ July 17, 2005: Message edited by: Sonny Gill ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sonny Gill:
Yash, the directory you created was WEB-INF and not WEB-INI, right!

[ July 17, 2005: Message edited by: Sonny Gill ]


The JSP wouldn't have run if he had named it WEB-INI
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mmm..yeah you are right...the context would not be created correctly. Good catch
[ July 18, 2005: Message edited by: Sonny Gill ]
 
yash Vi
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yash, the directory you created was WEB-INF and not WEB-INI, right!


Yes That was a typo ,I created WEB-INF
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!