• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Having trouble doing the first example in SCWCD

 
Jay Dilla
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the head first jsp/servlet book
I set my file structure like what's in the book, I created the form in the development and deployment environment and the web.xml file in the development and deployment environment
Then I started up tomcat and test the localhost site
that worked
then i tried to bring up the form using /Beer-v1/form.html but i get an error saying it's unavailable.
Anybody know what I may have done wrong?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post your directory stucture ?
 
Jay Dilla
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Christophe Verre:
Can you post your directory stucture ?


I'm at work now so I can't post the exact structure yet(I will when I get home).
But I know I have my development directory under the C drive in a folder named MyProjects. I have my deployment directory under the C drive in a folder called Tomcat.
I put the html file in my WEB-INF folder under the deployment structure.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have the book in front of me but typically you won't put html files under WEB-INF because the browser won't be able to access them from there (WEB-INF is a protected folder).

Also, make sure the sample applications with Tomcat are working before you try to create anything on your own. Quite often people think their application isn't working when in fact they never really got Tomcat working to begin with.
 
Jay Dilla
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marc Peabody:
I don't have the book in front of me but typically you won't put html files under WEB-INF because the browser won't be able to access them from there (WEB-INF is a protected folder).

Also, make sure the sample applications with Tomcat are working before you try to create anything on your own. Quite often people think their application isn't working when in fact they never really got Tomcat working to begin with.



The sample applications in Tomcat are working.
I think you're right about the WEB-INF. I'm not sure right now if my html is in the WEB-INF folder or "next" to it.
[ September 19, 2007: Message edited by: Jay Dilla ]
 
Jay Dilla
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyone have any clues for this?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you should have is :

${CATALINA_HOME}/webapps/Beer-v1/form.html
${CATALINA_HOME}/webapps/Beer-v1/WEB-INF/web.xml
${CATALINA_HOME}/webapps/Beer-v1/WEB-INF/classes
${CATALINA_HOME}/webapps/Beer-v1/WEB-INF/lib

Where CATALINA_HOME is the home directory of Tomcat.
 
Jay Dilla
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Christophe Verre:
What you should have is :

${CATALINA_HOME}/webapps/Beer-v1/form.html
${CATALINA_HOME}/webapps/Beer-v1/WEB-INF/web.xml
${CATALINA_HOME}/webapps/Beer-v1/WEB-INF/classes
${CATALINA_HOME}/webapps/Beer-v1/WEB-INF/lib

Where CATALINA_HOME is the home directory of Tomcat.


Thats what I have, should there be anything in classes or lib?
 
Jay Dilla
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apparently I was using the wrong extension. I was using html. I have to use htm on my computer. not sure why. any one know about this.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was using html.

html is ok. Try to rename it again to ".html" and retry.

Which version of Tomcat are you using ?
 
Jay Dilla
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't work when i use html. I'm using tomcat 5.0
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That used to be a Windows problem. Back in oh around Windows 98 and prior Windows couldn't handle file extensions greater than three characters.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic