I am having a little trouble when deploying my web app to a shared server.
The includes files I have within most of my JSPs simply won't work. Here is an example includes file
The error I am getting when running this is...
org.apache.jasper.JasperException: File "/includes/headincludes.jsp" not found
javax.servlet.ServletException: File "/includes/headincludes.jsp" not found
Looking around on Google there doesn't seem to be many useful answers available for this issue. Except that this may be caused by the AppBase / DocBase settings in Tomcat. The problem there is that when using a shared server I don't have access to the Tomcat settings to alter this.
I have tried adding the attribute -- flush="true" -- to the jsp:include tag, and whilst that begins to generate the HTML, it stops at the first includes statement.
Has anyone come across this issue before and a way to possibly fix this?
Edit: When I request the file directly it works fine. I believe it to be an issue with the virtual directories shared hosting plans set up, so that "/" isn't actually www.website.com root, but the root of the server hosting various customers websites. Although my knowledge in that area is very limited.
I will contact my web host regarding this issue then to see if they need to change any settings.
Just to check I have actually deployed the web app correctly (first time I have tried deploying it).....
I just copied everything from the "build" folder generated by Netbeans (which is all of the jsp files, class files etc all in their correct directories) into the root of my webhosting. Is that all that I needed to do?
Netbeans simply separates all source files from the files that get uploaded to the server.
So everything that has been uploaded is just the JSP files, all WEB-INF class / library files.
By the sounds of things I have uploaded everything correctly. Just wanted to check I haven't missed something blindingly obvious such as a line of code in web.xml in relation to JSP's / includes or anything - but it it doesn't sound like it.
I will see what my web host has to say about it.
Thanks for help.
posted 8 years ago
Got this sorted with web host.
What was interesting was that www.website.com/dashboard.jsp worked, whilst www.website.com/secure/dashboard.jsp caused the errors listed above.
The solution to this was to copy the 'includes' folder into the 'secure' folder and then it worked. Whether this is actually a good solution, I am not sure, but it solved the problem.
But if I'm not mistaken, the way you say that things are working would be the way that things would work if you had this code:
posted 8 years ago
I'm just having another play with the Servlets which have been mapped to specific URLs and something still quite doesn't seem right here, since none of them are working. Now this may just be a lag between the server refreshing the changes made in web.xml - or it could mean that the apparent fix hasn't actually fixed anything at all.
I will check on this again tomorrow.
Edit: Looking at the basic error logs I can see, this doesn't seem to be solved at all, since the "/" (root) is actually referring to the ROOT of my folders on the server, and not of the actual web app.
Which is showing a "file not found" error.
These are the worst of times and these are the best of times. And this is the best tiny ad: