| Author |
how can i include a JSP in an HTML page?
|
Neeraj Macker
Ranch Hand
Joined: Nov 10, 2004
Posts: 77
|
|
|
i have a index.html page. i cannot change its extension from .html to .jsp i need an application to run in background and this application is launched by this JSP. i want this JSP content to be a part of each page in my web application. hence i want to place it in a frame in index.html. how can i do it?
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
|
You could create a mapping in your web.xml file that points the URL "/index.html" to either a servlet or to your JSP page.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Neeraj Macker
Ranch Hand
Joined: Nov 10, 2004
Posts: 77
|
|
|
but this will not solve the problem because when i will change the page from index.html to consequent pages, the JSP will not exist anymore. i want to include the JSP in a frame in an HTML page.is it possible?
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
|
You could use an iframe in each page.
|
 |
Neeraj Macker
Ranch Hand
Joined: Nov 10, 2004
Posts: 77
|
|
i am sorry, but this will also not solve the problem. i dont want that application JSP to reload with every page. it needs to be loaded only once throughout the session of the user. i can not create a index.jsp with two frames. as i have said in the other thread of mine : HTML Frames and JSP! (http://www.coderanch.com/t/287429/JSP/java/HTML-Frames-JSP) these are two interdependent problems. please give me solution. i am stuck up.
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
If index.html is a frame set, just create one frame for your JSP and another for main content window. I'm not sure I understand what the question is. Are you just asking how to build frames in a browser?
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
If all you're looking for is help with Frames and setting the "target" attribute, this thread would be better off in the HTML/Javascript forum. I'm sure the moderator will move it there soon. Can you post the code to your page with the frameset element?
|
 |
Neeraj Macker
Ranch Hand
Joined: Nov 10, 2004
Posts: 77
|
|
Originally posted by Ben Souther: If index.html is a frame set, just create one frame for your JSP and another for main content window. I'm not sure I understand what the question is. Are you just asking how to build frames in a browser?
yes, this is just exact the solution, it just did not strike me. thanks a million.
|
 |
 |
|
|
subject: how can i include a JSP in an HTML page?
|
|
|