I have got a ROOT application on my tomcat application server. When I add files to the ROOT folder I can't access them. I had files in the folder before which were named help.html and index.html and they seem to work fine. Any new files which I create, I get 404 error when trying to access them. The permissions are the same. Any clues why ?
Are they *.html files as well? Have they the same owner and permissions as the rest of the files?
Related
i have a tomcat webapp which is called "app". Inside the folder tomcat/webapps/app/ is a file named index.html (as you can see in the screenshot)
when i start my tomcat and try to access the file with the url
http://localhost:8080/app/index.html
then i get a 404 - not found error. What am I doing propably wrong? I allready checked the rights of the tomcat directory on the filesystem and have all rights to access all files in the directory
Thank you in advance!
Hmmm try by changing permissions on the folder and make sure you apply the permission recursively (so this step "Replace all child object permissions with inheritable permissions from this object") so all the folders underneath your tomcat take the same command like here: https://serverfault.com/questions/157461/set-permissions-recursively-on-windows-7
Use the Sysinternals Process Monitor to see where Tomcat is looking for files when you do the HTTP request. This will help you understand what's going on.
My spring-hibernate project working perfect in my local PC but when i am deploying .jsp files are running fine but controller are not running.
Its gives 404 Not found error.
And my another project will run perfect on server.
same directory structure of both project.
[live server directory structure : /home/fugen/public_html/myproject]
What are the issues? i have spent two days,but still i am facing.
Thank to all in advance.
my project is on cPanel.
Put your jsp file on WEB-INF directory and where you refer this directory refer its directly by jsp file name.
filePath="fileName.jsp"
But if your file in under any directory of WEB-INF put its full path, e.g. WEB-INF/jsp/filename.jsp
I developed a web application and deployed in tomcat6. Actually, this web application has number of property files. Now, we placed all property files in WEB-INF/classes directory and So, the web app is running perfectly as this is default class path. Now, I want to keep all property files in a separate directory webapps/web_application/config and add this directory to tomcat class path. So that I don't have to change any java file for specifying new path of property files. I googled it a lot. But, every one is suggesting to place all property files in tomcat_home/XXXX and add this path in tomcat_home/conf/catalina.properties file attribute shared.loader="" . But, I do not want to do like this as these property files are my application specific. Is there any way to add webapps/web_application/config directory to classpath . Appreciate any help.
You can use a Manifest Class-Path entry to modify the web-app's class path.
Note that I would not use webapps/web_application/config because this location would be accessible from a web browser.
I created a simple Maven web app project, with 1 jsp file index.jsp. I am able to access this file from server as follows:
http://localhost:8080/myProject/
How does it is able to access my index.jsp ? I haven't specified anything on web.xml. Where does all these configuration was exist ?
2.) Can I change the URL to like http://localhost:8080/myProject/webapp/index.jsp ?
If you're using the Maven Standard Directory Layout, then everything located in the Web application sources directory (src/main/webapp) will be in the root of the application and will be public.
If you want to create /myProject/webapp/index.jsp, then create a webapp folder inside the src/main/webapp folder, so you will have folder structure like src/main/webapp/webapp (Which I don't see any reason to use it that way). Then create the index.jsp inside it.
I have a folder called attachments in my webapps folder in my Apache Tomcat directory, in which I need to save some files and images. When I'm giving the local path i.e. in C:/ the files needed are being saved in the correct location.
However I need to load these images from the server at runtime so I'm trying to access the image by the localhost url /attachments/img.png. The image is not being found (404 error).
I tried opening Tomcat's manager to see if attachments is listed. It is there however when I click it a 404 error is being thrown too. Other deployed web applications are being found.
What could be the cause of this?
You cannot just create a folder in $CATALINA_HOME/webapps like this and access it from web browser.
webapps folder is supposed to be home for all web applications with proper J2EE web app like directory structure e.g. WEB-INF/web.xml, WEB-INF/classes, WEB-INF/lib, META-INF etc.
Read more about Web Application Directory Stricture