I cannot access my index.html from my .war file. I placed the index.html in the root war file path. This is also where the META-INF and WEB-INF folders are located. When I try and access it from my url http://localhost:8080/Test/index.html i get
"JBWEB000065: HTTP Status 404 - Could not find resource for relative : /index.html of full path: http://localhost:8080/Test/index.html"
On my server.log I see that the server started successfully without any errors. Also, when I try and access the page I do not get any stack traces on the server.log. I also have a web service built within the war file and when I test the RESTful service (http://localhost:8080/Test/Query?key=Hello%20World) I get a successful response.
What am I doing wrong that I cannot access the web page?
"Could not find resource for relative : /index.html" indicates your app is trying to dig up index.html as a RESTful resource and not as a static file.
Without seeing your web.xml, I'm guessing you have a <servlet-mapping> entry that's handling all URL patterns; something like this:
<servlet-mapping>
<servlet-name>My RESTful servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
To address this issue, this SO looks helpful, which essentially suggests adding an additional token to the path to your resources, such as:
<url-pattern>/service/*</url-pattern>
This means you'll have to access your Query resource as http://localhost:8080/Test/service/Query?key=Hello%20World.
Related
I have a website setup in IIS that has an application within it. For whatever reason, IIS can't access the web.config of this sub application. Looking in the website directory, the config file is right where it should be.
If I try to edit (through IIS manager) any configurations of the sub application I get the following error:
The file path in the error notification is correct, except for '\\?\' appended to the beginning.
The parent website web.config has no issues, and can be configured through IIS.
What could be causing this error? Thanks in advance.
Needed to install the component IIS URL Rewrite Module 2. Once this was in place, the web.config was consumed properly.
I am trying to serve a React app from Google Cloud Storage. I built the React project and uploaded the contents of the build/ directory to Google Cloud Storage. I made sure every file inside is publicly accessible. However when I go to my Google Cloud bucket link http://storage.googleapis.com/BUCKET_NAME/, I get some XML about a permission error:
<Error>
<Code>AccessDenied</Code>
<Message>Access denied.</Message>
<Details>
Anonymous users does not have storage.objects.list access to bucket BUCKET_NAME.
</Details>
</Error>
Then, I tried to navigate to the URL http://storage.googleapis.com/BUCKET_NAME/index.html, which brings up a blank page. In the JS console, there are errors:
index.html:1 GET http://storage.googleapis.com/static/css/main.9a0fe4f1.css
index.html:1 GET http://storage.googleapis.com/static/js/main.871fec8f.js
These errors look like the BUCKET_NAME is not in the URL that was fetched. However, my built index.html is referencing them relatively, as so:
<script type="text/javascript" src="/static/js/main.871fec8f.js"></script>
I'm not sure what's going on, there are two issues. First is that index.html is not the default served page when going to the bucket URL. Second issue is that the relative paths don't seem to be resolving the right URL. Any help is appreciated.
This was a problem on my end. This method should work.
I am using tomcat to run CGI. I did all required configuration as per tomcat-CGI docs.
Deleted the comments in web.xml and adding <Context privileged="true">. In web.xml, I gave the "cgiPathPrefix" the value "cgi-bin", and I added this cgi-bin folder in the webapps/mycgiproject directory.
When I deploy it tomcat it shows me a blank page. couldn't find a reason since no error or log is generating.
Generally CGI files starts from -
#!/usr/bin/perl -T
But when i give space it works.
#! /usr/bin/perl -T
I am curious though I may find a way for this issue, but want a real solution to this problem ?
Also anyone knows how should be the folder structure inside tomcat.
My configuration is as follows -
tomcat/webapps/myperlproject/cgi/"cgi files"
in tomcat/conf/web.xml -
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>cgi\</param-value>
</init-param>
is it right ?
im creating a scala -maven web project for kindergarten kids..
But the problem is when i accessing a image from resource-image folder i does not show image
But when i read page with browser it will show the image ..
So is there any solution for showing image while running from jboss
In your spring configuration context for the application (in my case its usually a app-context.xml), have you defined the resource mapping? For example, to serve all static content from a root "static" folder:
<!-- Handles HTTP GET requests by efficiently serving up static resources in the ${webappRoot}/static directory -->
<resources mapping="/static/**" location="/static/"/>
If you are also using spring security (security-context.xml), you'll want to make sure you have excluded "static" similar to:
<security:http pattern="/static/**" security="none"/>
This should allow you to resolve an image in the application like so:
http://www.somedomain.com/myApp/static/img/uglymug.jpg
http://www.somedomain.com/myApp/static/style/uglymug.css
http://www.somedomain.com/myApp/static/script/uglymug.js
HTTP Status 404 - /JspTest1/
type Status report
message /Projectname/
description The requested resource (/Projectname/) is not available.
Check if the directory structure and the files (like web.xml etc ) are correct.
Also recheck the path (URL) that you are using in your browser to access your app.
Check the logs in tomcat folder for more detailed explaination of error. Also try to put you app in webapps and then run in tomcat directly