1

Hi I have one Jsp page and i want to call that jsp page in my another jsp page. for example i have includefile.jsp page

 <html>
<body>
    <b><font color='red'> Hello World</font></b><br>
    <b><font color='red'> HTML file is included in JSP page<font></b>
</body>
</html>

and i have include.jsp page where i want to call the first jsp

<html>
<body>
<%@ include file='includedFile.jsp' %>
</body>
</html>

but this code is not working. I will really appreciate if someone can help me out with this.

Saurabh
  • 955
  • 6
  • 14
  • 22
  • have you seen this http://stackoverflow.com/questions/9110148/include-another-jsp-file and also make sure about the directory structure that Are you giving the right path of `includedFile.jsp` – Freak Mar 04 '13 at 07:13
  • yes i am giving the right path. both jsp are in the same folder and i dnt knw whats wrong with it and i have seen that example of stack over flow also but i am unable to make my code work with that example. – Saurabh Mar 04 '13 at 07:39
  • try to remove and tags from your includedFile.jsp and then check – Freak Mar 04 '13 at 07:46
  • o I jsut see! at the start of question you wrote file name `includefile.jsp` and in the code , you used `includedFile.jsp`.Make sure that you are giving right name as well as case sensitivity in file name – Freak Mar 04 '13 at 07:48
  • yeah the name I have corrected and even i have tried removing and tag still it is not working – Saurabh Mar 04 '13 at 07:54

1 Answers1

2

In your include.jsp page

<html>
<body>
<form action = "includeFile.jsp">
<input type="submit" value="open other jsp">
</form>
</body>
</html>

**make sure to place both JSP files in same folder.

Nickhil
  • 1,267
  • 10
  • 11