aspose file tools*
The moose likes Servlets and the fly likes WEb-INF and web.xml problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "WEb-INF and web.xml problems" Watch "WEb-INF and web.xml problems" New topic
Author

WEb-INF and web.xml problems

Ahmed Zeeshan Pervaiz
Greenhorn

Joined: May 28, 2011
Posts: 5
Hey,
I'm a noob at servlets design, but i'm really interested in it, so i picked up headfirst book. There is an example in the book for which i have two problems. im using tomcat6 with java6, and the book uses earlier versions for both. now my problems are
1- when i first deployed it, i used the WEB_INF in my tomcat6 folder, and the form.html opened up fine, but then i renamed it to WEB-INf and it did'nt work. but the book uses WEB-INF so what is the problem here.
2- This the big problem, from what i can gather because i'm using different versions of tomcat and java the web.xml header has to be different, so this is what i'm using.


btw i'm also wondering if swithching to an IDE would be less hassle, what do you people think and which IDE should i switch to NETBEANS or Eclipse

Thanks a lot
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

How many different ways are you going to type WEB-INF? Only WEB-INF will work, not WEb-INF, not WEB_INF, not WEB-INf.

If the IDE is a hassle, don't use one for deployment. I use an IDE for editing, but deploy to a standalone Tomcat instance.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ahmed Zeeshan Pervaiz
Greenhorn

Joined: May 28, 2011
Posts: 5
I'm sorry i typed it wrong the first time,
For me the form.html file opened correctly when i used WEB_INF and did'nt work when i used WEB-INF, btw the form.html file is not in this folder, instead it is in the project folder where WEB-INF is also present.
And the other problem remains the same that is of the servlet.do
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

WEB_INF is not valid. If naming it correctly causes problems, it's likely a configuration error. What have you done to debug this? Have you used the Tomcat Manager to see if the web app is starting? Have you checked the logs for errors during startup? Have you validated your web.xml?
Ahmed Zeeshan Pervaiz
Greenhorn

Joined: May 28, 2011
Posts: 5
hmm....
Ahmed Zeeshan Pervaiz
Greenhorn

Joined: May 28, 2011
Posts: 5
but when i use WEB_INF it loads my form.html, and when i use WEB-INF it does'nt so what sort of configuration error is this. I'll have to look at a tutorial for tomcat manager to see the rest.
I validated my web.xml and its okay but i'm guessing the problem is somewhere is due to the fact that im not using the right header for my version and the only way to go about this would be to look at someone who has used the right version.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Ahmed Zeeshan Pervaiz wrote:but when i use WEB_INF it loads my form.html, and when i use WEB-INF it does'nt so what sort of configuration error is this.

When you use WEB_INF it's meaningless and being completely ignored. If there's a config error in your web.xml, it's not going to show up in an invalid structure because the container won't even be looking at it.

Anything in the logs?
Ahmed Zeeshan Pervaiz
Greenhorn

Joined: May 28, 2011
Posts: 5
Alright i'll look at the logs and let you know if I can find anything relevant there, or maybe i'll just post the whole thing online.
btw which environment do you use for your jsp servlet programming? im using ubuntu with no IDE, although i want to use something that saves me from all this pain.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

In my opinion, using an IDE will not save you from any pain.

I use Mac OS X running Tomcat 6 and PostgreSQL, and IntelliJ IDEA for editing, but deploy in a standalone Tomcat instance.
 
Don't get me started about those stupid light bulbs.
 
subject: WEb-INF and web.xml problems