Skip to content Skip to sidebar Skip to footer

Same Url For All Pages

I'm working on a proyect in JSP, but i want to show in the navigator bar the same url for all the pages in my proyect. I know how to do it with iframes and frameset, but I'm lookin

Solution 1:

Single page web apps where all page changes are done via AJAX are certainly possible, and are actually gaining popularity with frameworks like Backbone.js. The exact implementation is going to vary wildly based on the nature of your project, so there isn't really much to say without more specific information.

As the simplest example I can think of, you could just have a link on your page run the following javascript (with jQuery) to completely reload the body of the page:

$("body").load("/path/to/new/body.htm");

Solution 2:

You can load a page that will update the HTML DOM using Ajax.

The main page: foo.com/bar

<div id='ajax_container'>

</div>

Then in you JS, for specific user action (click in a menu...):

$(function(){
  $('#baz').click(function(){
    $.ajax({
     url: "foo.com/bazzz",
     cache: false
    }).done(function(html) {
      $("#ajax_container").append(html);
    });
  });
});

http://api.jquery.com/jQuery.ajax/

Solution 3:

You can use the switch condition in the same servlet .

Post a Comment for "Same Url For All Pages"