aspose file tools*
The moose likes JSP and the fly likes The requested resource (/basic/date.jsp) is not available. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "The requested resource (/basic/date.jsp) is not available." Watch "The requested resource (/basic/date.jsp) is not available." New topic
Author

The requested resource (/basic/date.jsp) is not available.

pravin gajbhiye
Greenhorn

Joined: Aug 20, 2012
Posts: 21
HI

I have installed ...
1) jdk 1.7.0_03
2)tomcat 6.0.35

I have tested tomcat by accesing http://localhost:8080.
Its working fine.
and also jdk is working fine.
I want to learn jsp.
I have create one folder in webapps named basic.
In basic i have created one more folder WEB-INF.
i have created one file called date.jsp which stored in basic folder
and one more file i have created called web.xml which stored in WEB-INF folder.

date.jsp



web.xml>>>>


and restart the tomcat server.
and fired the url

http://localhost:8080/basic/date.jsp


but getting error like ...........

==========================
HTTP Status 404 - /basic/date.jsp

type Status report

message /basic/date.jsp

description The requested resource (/basic/date.jsp) is not available.
Apache Tomcat/6.0.35
============================

Please help me to fixed this issue.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

pravin gajbhiye wrote:I have create one folder in webaap named basic.

webaap? Is that real or a typo. If the latter, please take as much care in posting as you would incoming. Programming is all about accuracy and precision. Please be precise and correct when posting.

If you really did spell it "webaap", well, that's obviously wrong.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
James Boswell
Bartender

Joined: Nov 09, 2011
Posts: 973
    
    5

Remove the basic folder but maintain the structure under it from the webapp folder.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information. Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.

I've gone ahead and added the code tags for you. See how much easier the code is to read?
pravin gajbhiye
Greenhorn

Joined: Aug 20, 2012
Posts: 21
Thax for quick reply.
But i did not get.
How it remove?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

James Boswell wrote:Remove the basic folder but maintain the structure under it from the webapp folder.

Not correct. webapps should contain the web root of the application; it does not serve as the web root itself.
pravin gajbhiye
Greenhorn

Joined: Aug 20, 2012
Posts: 21
Hi
I have removed the basic folder and created file dateToday.jsp in webapps
and also created WEB-INF folder in webapps.In WEB-INF created file web.xml.
and restart the server.
But giving same error.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

By the way, your web.xml is not correct for Tomcat 6 -- the Servlets 2.3 DTD is for older versions of Tomcat.
pravin gajbhiye
Greenhorn

Joined: Aug 20, 2012
Posts: 21
Can you provide me the right web.xml.?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

You'll need to learn how to look that sort of thing up for yourself. Here's a link to the FAQ: https://www.coderanch.com/how-to/java/ServletsWebXml
pravin gajbhiye
Greenhorn

Joined: Aug 20, 2012
Posts: 21
I am trying this url

http://localhost:8080/ROOT/index.jsp

But its also not working.
is there any Zar code for jsp that I have to download?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

pravin gajbhiye wrote:I am trying this url

http://localhost:8080/ROOT/index.jsp

But its also not working.

Trying random stuff isn't going to help. What happens when you just hit: http://localhost:8080/ ?

is there any Zar code for jsp that I have to download?

Zar code?
Divya Janyavula
Greenhorn

Joined: May 24, 2011
Posts: 19
I would prefer to search for a simple servlet tutorial and understand the details. Then you can implement one on your own.
pravin gajbhiye
Greenhorn

Joined: Aug 20, 2012
Posts: 21
when i hit http://localhost:8080/ , it shows Apache Software Foundation site.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

OK, so that means that Tomcat is running. Have you checked the logs to see if there are errors that prevent your app from deploying?

After that, I'd get the Tomcat Manager set up so you can see what's running and what's not. See the Tomcat documentation for details.
pravin gajbhiye
Greenhorn

Joined: Aug 20, 2012
Posts: 21
Hi
Now I am reffering HeadFirst for servlet and Jsp .
I have created here Beer-v1 project.
here i have created one servlet class, one module i.e. plain java class, and one html form.
I am taking the output or response on the screen through servlet by using PrintWriter.So its working properly.
But when i used jsp for response by calling the jsp file from servlet its giving error.I have compiled the servlet after calling jsp file.It gets compiled properly.
but thrwing the error >>>> The requested resource (/Beer-v1/result.jsp) is not available.
I have put jsp and html files in Beer-v1 folder.
web.xml > WEB-INF
.class files in classes/com.example.model and classes/com.example.model.

But the one thing is that I saved html file in Beer-v1 folder, i observed that the type of file is Html, but i saved jsp file then the type file is text.
pravin gajbhiye
Greenhorn

Joined: Aug 20, 2012
Posts: 21
Above problem is resolved. but result.jsp which is calling from servlet using RequestDispatcher view=request.getRequestDispatcher("result.jsp");
to show output. but showing blank screen.
In adress bar it shows address http://localhost:8080/Beer-v1/BeerSelect.do instead of http://localhost:8080/Beer-v1/result.jsp
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

pravin gajbhiye wrote:In adress bar it shows address http://localhost:8080/Beer-v1/BeerSelect.do instead of http://localhost:8080/Beer-v1/result.jsp

That is correct.
pravin gajbhiye
Greenhorn

Joined: Aug 20, 2012
Posts: 21
Finally I got expected result. Thax to all.Its resolved now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The requested resource (/basic/date.jsp) is not available.
 
Similar Threads
Unable to run web application(java) on tomcar server
HTTP Status 404 - /Ch03/
problem with JSP deployment in tomcat
requested servlet is not available
Executing my first servlet program