• Post Reply Bookmark Topic Watch Topic
  • New Topic

fixed URL  RSS feed

 
Ian Cabigon
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I'd like to ask if there is a way to make the URL fixed. Here is the scenario I'd like to end up with:

URL: http://www.example.com/fixedURL/
User clicks button that would change location to : http://www.example.com/fixedURL/page1.html
page1 is loaded.
Browser URL (address bar) does not change. will remain: http://www.example.com/fixedURL/

is there a way to do this in servlets or javascript ?

Please share some of your thoughts.

Ian
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What, precisely, are you trying to do? You could use Ajax, you could use a forward instead of a redirect, it depends on the usecase.

If the page changes under me I expect there to be a new URL, though.
 
Ian Cabigon
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks David.

I just would like to make the URL fixed and clean. as what you have said, like ajax feel. but still, there are page reloading, page transition but virtually no URL change in address box.

If you can think of a possible way to do this either by servlet or javascript, id like to hear from you.

So far i've tried to change the url location on javascript load like:



hehe.. but page reloads!.(

Ian


 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you can use a frame around your site...
 
Ian Cabigon
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rene.

Yeah! you're right. I was trying to avoid using IFrames but I guess its the way to do it.

Thanks

Ian
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ian Cabigon wrote:Thanks Rene.

Yeah! you're right. I was trying to avoid using IFrames but I guess its the way to do it.

Thanks

Ian

I'm not saying iFrames - but just a normal HTML frame like this as the default page (index.html ??):
 
abhijit Ohal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is easy solution for mention issue.

You can achieve this by submitting request to server using POST type of request.

If you are using links (<a href tags) in code then call JavaScript function to submit the request. <br /> <br /> In general POST type of request won’t be displayed in Browser URL (address bar) <br /> rel="nofollow">
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66153
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
abhijit Ohal wrote:In general POST type of request won’t be displayed in Browser URL (address bar)

That is completely and 100% incorrect.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!