aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Unable to locate the .jsp file error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Unable to locate the .jsp file error" Watch "Unable to locate the .jsp file error" New topic
Author

Unable to locate the .jsp file error

Siri Naray
Ranch Hand

Joined: May 19, 2006
Posts: 105
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


If you worry you cannot work... If you work you need not worry
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

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

Joined: May 19, 2006
Posts: 105
Sorry I gave it wrong. They are actually saved in Web-Contents folder.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61420
    
  67

Web-Contents? Is this within an IDE? There's no such folder that's standard.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

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

Joined: May 19, 2006
Posts: 105
its WebContent in Eclipse
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

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

Joined: May 19, 2006
Posts: 105
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

Joined: Feb 07, 2012
Posts: 344

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

Joined: May 19, 2006
Posts: 105
@Koen
Yes the cases are all matching. Still trying to figure out.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16141
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Siri Naray
Ranch Hand

Joined: May 19, 2006
Posts: 105
@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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to locate the .jsp file error