I need to include a html content into a JSP. But I will come to know about the JSP file where i need to include the html at runtime only. Please help me how to perform this.
Bear Bibeault
Author and opinionated walrus
Marshal
You can make use of ajax and servlets in this context. You can create a servlet which responds to the ajax request and returns the htmlcontent of the related keyword. At browser side, when the search button is clicked then in the background , send a request to the servlet using ajax with keyword as input parameter.
After you receieve the response you can
1. open an new window with responseText.
2. include the responseText as div innerHTML.
Hope it solves your problem.
Balaji Krishnan
Greenhorn
Joined: Dec 14, 2011
Posts: 8
posted
0
Hi Ravi,
Thanks for your help here. I don't know anything about AJAX. I don't have open an new window to show the responseContent(html).
When i mention redirect, it will redirected to an existing screen in my application. This is where i need to include the HTML content without affecting page layout. Is this possible?
Sorry if i din't get your point correctly.
Tarun Bolla
Ranch Hand
Joined: Jun 20, 2011
Posts: 85
posted
1
Balaji Krishnan wrote:
When i mention redirect, it will redirected to an existing screen in my application. This is where i need to include the HTML content without affecting page layout
You can do that ...
From page A you will be sending a parameter to page B.
Page B will display the content that is relavant to the parameter.
What is the problem you are facing here? And as far as layout is concerned, you can always adjust your layouts according to your need. Sometimes you can solve things when you jumpstart the coding.