.jsp page gives exception when hosted to the server.

This the error message:

HTTP Status 500 -

type Exception report


description The server encountered an internal error () that prevented it from fulfilling this request.


org.apache.jasper.JasperException: /StudentProfile_1.jsp(17,2) File "/../Redirection.jsp" not found
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.35 logs.
LVL 16
CWS (haripriya)Asked:
Who is Participating?
BardobraveConnect With a Mentor Commented:

J2EE tutorial


Deploying web applications to Tomcat

I hope you found some answers there.
CWS (haripriya)Author Commented:
Additional Info:

The same set of files when stored inside a folder called 'web' works fine.
Well.... it seems a path problem.

Your /StudentProfile_1.jsp file seems to be trying to load a Redirection.jsp file that is not placed in the path you specify. Probably your folder structure on development and production environments is different? Check those folder structures and fix your file routes. You'll probably face more issues like this.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

CWS (haripriya)Author Commented:
Redirection.jsp file exists in that path. Anyone else?
>"/../Redirection.jsp" not found
Your path seems odd.  
Did you try without the leading "/"
If that doesn't work, then show us your file structure and  your code.
If inside a folder "web" it works and outside of it it doesn't seems pretty obvious that there is something wrong on your paths or on your folder structure, but we cannot guess it.
CWS (haripriya)Author Commented:
These two line are the one which gives error.

<%@ include file="../Redirection.jsp" %>
<%@ include file="../connection.jsp" %>

Even if I give the direct absolute path like "http://www.website.com/Redirection.jsp" it gives the same error.

The path are ok. I checked many times. The whole website works fine if it is inside a 'web' folder. All are relative paths only. So, if I upload the files to 'public_html' it should work. But gives error. This is not my  project. I am only hosting it in the server. Additional info is that the project was built using NetBeans and I am hositng it in Tomcat server. I have no idea why NetBeans create a folder called 'web' and creates all the project files.

After some research in the internet I found that context.xml and web.xml files are important. Anyone know what am I supposed to do in that xml files so that the website works?
rrzConnect With a Mentor Commented:
If the JSPs that you are trying to include are in the same folder as StudentProfile.jsp , then try  
<%@ include file="Redirection.jsp" %>
<%@ include file="connection.jsp" %>

If they are in the root folder of your web app, then try
<%@ include file="/Redirection.jsp" %>
<%@ include file="/connection.jsp" %>  

If those don't work, then show us the file structure on your server.
CWS (haripriya)Author Commented:
Sorry for the delay. Thanks for all the suggestions.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.