• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to locate the .jsp file error

 
Siri Naray
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
CAn someone help me understand why am I getting "message /SQL.jsp description The requested resource (/SQL.jsp) is not available. for the following. Both .html and .jsp files are in WEBContent folder only. And I copied the jar files. Independently when I run the programs both are running fine. In SQL.jsp file Query I gave deptno =10 to check and its showing me the output. The only problem is the server is not able to locate SQL.jsp. I dont udnerstand why.







Thank you
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure if HTML and JSP files will work when they are located under WEB-INF... try to move them one directory "up" from there...
 
Siri Naray
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I gave it wrong. They are actually saved in Web-Contents folder.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web-Contents? Is this within an IDE? There's no such folder that's standard.
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, what is the context path of your web app (you can see that for instance in your URL)? It seems to be looking for something under / but if your web app is located under in context path, for instance http://localhost/mywebapp/index.jsp and you're trying to access http://localhost/index.jsp then it won't work.
 
Siri Naray
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its WebContent in Eclipse
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, are you sure the requests match the jsp file name and cases exactly; SQL.jsp and not sql.jsp, or Sql.jsp, etc.?
 
Siri Naray
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One more point I observed is.. When I rename SQL.jsp to anyother name like JSTLSql.jsp and now run it still shows the old SQL.jsp file name. I have to exit the Eclipse for any changes to be effective. Why?
 
Koen Aerts
Ranch Hand
Posts: 344
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sirisha Ghatty wrote:One more point I observed is.. When I rename SQL.jsp to anyother name like JSTLSql.jsp and now run it still shows the old SQL.jsp file name. I have to exit the Eclipse for any changes to be effective. Why?

It depends on how you rename the file. If you do it through Eclipse, it should refresh automatically, if you do it outside of Eclipse (i.e. file browser) then you need to refresh the view in Eclipse after you renamed the file.
 
Siri Naray
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Koen
Yes the cases are all matching. Still trying to figure out.
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IDEs are wonderful things.

Except when you don't know what you're doing. In that respect, they're rather like chainsaws. If you don't hold them right...

The "Resource unavailable" message is not the same as (404) "Resource not found". I think what actually happened is that the JSP does not compile and therefore isn't available even though the resource URL does correctly point to the JSP resource itself.

This is where the IDE can make things worse. I've already railed against the offences of the WTP Tomcat manager, so I'll skip that, but to make a long story short, Eclipse is probably kicking around stale data.

The simplest way to diagnose and repair that is to remove Eclipse from the equation. Ideally, that means from the build point on (which is one reason why all my projects can be built via Ant or Maven without using an IDE at all). Failing that, however, build the WAR with Eclipse, shut down Eclipse, delete the files from the TOMCAT_HOME/work and TOMCAT_HOME/temp directories and delete the webapp's WAR file and exploded WAR directory from TOMCAT_HOME/webapps. Deletion of the exploded WAR is critical since Tomcat will use that even if the WAR file itself is newer.

Once you've done all of the above, launch Tomcat stand-alone. request the JSP, and see what happens.
 
Siri Naray
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Tim
thank you for teh reply. I did work on couple of other JSTL program and they are working fine. Dont know why this one is acting so differently. I did what you said but still the same error.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic