• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

http error404

 
Ranch Hand
Posts: 1051
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 152
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Shanky,
Put your .html outside WEB-INF directory. anything inside WEB-INF can't be accessed directly.

 
Ranch Hand
Posts: 2066
IntelliJ IDE Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Pravin Shirke
Ranch Hand
Posts: 152
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Creator of Enthuware JWS+ V6
Posts: 3412
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3412
320
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
keep an eye out for scorpions and black widows. But the tiny ads are safe.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic