• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Include a servlet in a jsp

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have the following problem.
I am trying to include in a div, the content shown by a servlet. I used to include my servlet in an iframe.

But now, I need to use divs, no more iframes.
I tried this:


The servlets was executed, but it was not shown on the jsp

Thanks!
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you say, "it was not shown on the jsp", do you mean that the output you expected wasn't visible or that it really wasn't included in the response? Did you view the source of the response in a browser? Perhaps there's just a problem with your HTML...
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the servlet generating? Are you sure it's valid HTML?

When the servlet was sending HTML to the iframe was it a full HTML page? if so, did you modify it to send a fragment? You can't just stick a full HTML page inside another HTML page.
 
matias casal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The servlet creates a html page in temp folder.
I used to use the iframe because it was the only way i found to put the reports in a jsp, but my boss suggested me to use divs, no more iframes.
Any idea?
 
Kris Schneider
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe the answer is too obvious . Instead of output like:



the servlet needs to generate output like:

 
Bear Bibeault
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You didn't answer my question. Is what is being sent to the browser valid HTML? If you are including a page with an <html> tag inside a <div>, that is not valid!

Do a View Source at the browser. Is the HTML page valid?
 
matias casal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The browser recieves <html><body>...</body></html>

Are you sure thats the error?

I tested

and abc.jsp is
and it works.
Thank you anyway

 
matias casal
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The html source is the following
 
reply
    Bookmark Topic Watch Topic
  • New Topic