• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ajax not loading .html file in a jsp page

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there all,

I am trying to combine ajax with jsp pages.
In my .jsp page I have this block :

<div id="rightColumnInternalWrapper">
<div id="rightRightColumnWrapper">
</div>
<div id="rightLeftColumnWrapper">
</div>
</div>

I have my .html page with an html block and in my .js file I am trying to load the .html file into the .jsp page like this:



When I am clicking the respective child of the mainMenuList element I am getting the 404 error in the Network section of chrome developer tools,
so it means that tomcat cannot find the page, even though I mapped it into the DD.

Any ideas what am I doing wrong and tomcat cannot find the page?

Thank you all in advance.
 
Sheriff
Posts: 67746
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

Antigoni Tsouri wrote:I am trying to combine ajax with jsp pages.


The fact that the page is generated form a JSP is completely irrelevant. When the response gets to the browser, it's just an HTML page like any other.

I have my .html page with an html block


Well, that's a problem. You can't shove an entire HTML page, including an <html> element, inside another HTML page.

The HTML fragment you are loading should not have <html> elements, and should only be the fragment of the HTML DOM that is legal to place at the point of insertion.

When I am clicking the respective child of the mainMenuList element I am getting the 404 error


Your HTML file is under WEB-INF which means it cannot be loaded directly via a URL. You'll either need to move it out of WEB-INF, or provide a controller that can forward to it.
 
Antigoni Tsouri
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, thanks for your immediate reply!

Actually it was just that the request.html was under the WEB-INF directory!

About the request.html page, I didn't have any <html> tags :-) , it was miswritting what you pointed out as a fragment.

Thanks a lot again!
 
Bear Bibeault
Sheriff
Posts: 67746
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic