File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes http error404 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "http error404" Watch "http error404" New topic
Author

http error404

Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

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.



[Thumbnail for error.png]


SCJP6.0,My blog Ranchers from Delhi
Pravin Shirke
Ranch Hand

Joined: Apr 05, 2008
Posts: 150

Hi Shanky,
Put your .html outside WEB-INF directory. anything inside WEB-INF can't be accessed directly.



[Vipassana] - It is seeing the reality as it is, And not as you want it to be.!!!
SCJP1.5.
Abimaran Kugathasan
Ranch Hand

Joined: Nov 04, 2009
Posts: 2066

Shanky! as pravin said anything in the WEB-INF directory can't be accessed directly! It's a security mechanism in web application.


|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

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

Joined: Mar 17, 2010
Posts: 1051

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.




[Thumbnail for error.png]

Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

Pravin Shirke
Ranch Hand

Joined: Apr 05, 2008
Posts: 150

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

Joined: Mar 17, 2010
Posts: 1051

how can see the complete logs.'

like how the html calls--servlets--(java-model)--jsp.
Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

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
Bartender

Joined: Apr 07, 2010
Posts: 1715
    
  25

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

Joined: Mar 17, 2010
Posts: 1051

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
Bartender

Joined: Apr 07, 2010
Posts: 1715
    
  25

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: http error404