• Post Reply Bookmark Topic Watch Topic
  • New Topic

Redirect between html, jsp without changing the URL

 
vinay abhishek
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am planning to design a web application with multiple HTML and JSP pages. The first page of myapp (index.html) loads up with the url http://localhost:8080/mywebapp without an explicitly pointing it to http://localhost:8080/mywebapp/index.html because web-xml has index.html in its startup script. Thats perfectly fine!

But how to toggle between multiple JSPs and HTMLs that are in the web app keeping the URL constant - http://localhost:8080/mywebapp
The user should not be knowing the navigation pattern when he is using the web-app.
Ideas on any frameworks or implementations are highly appreciated.
Thanks



 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's possible, but to advise on an approach, please elaborate on this:
The user should not be knowing the navigation pattern when he is using the web-app.

That seems an unusual requirement.
 
vinay abhishek
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the prompt reply.
To elaborate,
Consider a scenario where there are few JSPs/HTMLs in my web-content namely:
1. login.jsp
2. profile. jsp
3. logout.jsp and so on....

No matter what JSP/HTML the user is presently in, I want to maintain a fixed URL for all the webpages.
http://localhost:8080/mywebapp

My plan is not to template a single page(index.html/jsp) to render different views...

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's still an odd requirement. What is the reason for it? Seems like a really bad idea.

You'll either need to frame the actual page, or develop an SPA (Single Page Application). (Though in the latter, a hash on the URL is frequently used to maintain state).

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems like FrontMan architecture to me, or am I missing something here.

Bill
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FrontMan will not prevent the URL from changing. I'm still mystified as to why this is a requirement.
 
Jayesh A Lalwani
Rancher
Posts: 2762
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right, it's just like frontman except that you would have the command sent in as a parameter, instead of the URL.

SO, instead of having http://myserver/mywebapp/command, you need something like http://myserver/mywebapp?command=....& param1=...& param2=... If you pass all the parameters as POST requests, user won't see his/her URl change

It's not hard to implement it yourself. but it would be almost like implementing a mini-frontman/struts/springmvc

However, Bear's question still stands. Why would you do it this way? Seems like you will have all the drawbacks of a SPA (not being able to bookmark) without any of the benefits (fluid UI)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jayesh A Lalwani wrote:all the drawbacks of a SPA (not being able to bookmark) without any of the benefits (fluid UI)

Quibble: well-written SPAs are bookmark-able. See my BlackBox game as an example. It's an SPA, but you can bookmark the game at any state and come back to it later at your leisure.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!