• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

http error404

 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rancher,

I am facing problem while running web application.
I am trying to create a example given in Head first Servlet and JSP in eclipse.

I created form.html in web-inf directory and servlet "BeerSelect.java" in src.com.example.web
everything is running fine.i am able to see the welcome-page of tomcad5.5 by entering http://localhost:8081/

I am attaching a screenshot of my eclipse for quick referce.

Please help.
error.png
[Thumbnail for error.png]
http error404
 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shanky,
Put your .html outside WEB-INF directory. anything inside WEB-INF can't be accessed directly.

 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shanky! as pravin said anything in the WEB-INF directory can't be accessed directly! It's a security mechanism in web application.
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks..I have created a folder name web
and created a file over there but it automatically got compile to web-content..

but thanks it got worked now..
i more thing
can i choose a folder where all the files got trasfered when i build my files.

like manually we do it using "-d" using command promt

 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now i am facing errro while running jsp.
i have put the result.jsp same where i have putt my html code.

see the screenshot for reference.

error.png
[Thumbnail for error.png]
jsp error
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi shanky,
Please put all your jsp's inside webcontent. or create a sub directory inside webcontent and put it there if you want it and then map it accordingly.
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can see the complete logs.'

like how the html calls--servlets--(java-model)--jsp.
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it.

that means
I have to put all my webconent(html and jsp) under webconent folder
and
all the java classes under src directory(java-model classes and servlet(which acts like a controller))

Please correct if i am wrong and try to include if any thing i am missing here...
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2533
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Shanky,

I have to put all my webconent(html and jsp) under webconent folder

Yes, but you can put a jsp-file under the /WEB-INF if you have a <servlet> in your web.xml defining the jsp-file
all the java classes under src directory(java-model classes and servlet(which acts like a controller))

Yes, and the *.class files in the /WEB-INF/classes directory

I always recommend creating a war file by hand a couple of times before using an IDE (see example)

Regards,
Frits
 
Shanky Sohar
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frits Walraven wrote:

I have to put all my webconent(html and jsp) under webconent folder

Yes, but you can put a jsp-file under the /WEB-INF if you have a <servlet> in your web.xml defining the jsp-file


hi
BOLD part doesnot seems to working
YES,My servlet defines jsp.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2533
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you have a <servlet> in your web.xml defining the jsp-file
BOLD part doesnot seems to working
YES,My servlet defines jsp.

It should work. Can you post your web.xml, Servlet, jsp and URL you are using?

Regards,
Frits
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic