kevin,
haven't written one in a while but you could include a javascript function
for the onload event handler in your pages that would check to see if the
page was in the context of your frameset and if not, go to your home page.
one problem with that approach is that you usually want to take the user to
the page they were trying to get to--but within the context of your
frameset. detecting that a page is not in the frameset and sending them to
your homepage (i.e. frameset page) is confusing to the user. what you
really want to do is make your frameset page dynamic so that you can specify
the page to load run time:
www.mysite.com/index.jsp?page=/whatever.jsp
normally your index.jsp page (which is the frameset page) would simply load
your home page when accessed, however if the page parameter existed, it
would load that page in the frameset instead. this allows you to put your
user wherever you want them but within your frameset.
the dirty thing about this is that they now see that url with the query
string in the address bar if you've had to 'place' them in the frameset
(instead of just coming there by going to your homepage www.mysite.com/)
a possible solution is to create a helper servlet/jsp that the javascript
could talk to and set the frameset context to the session. example:
page loads outside of frameset and is detected by a javascript function
the javascript function redirects to a helper servlet/jsp with the current
page in the query string (/FramesetServlet?page="currentpage.html")
helper servlet stores the page from the query string to the session
(enteredPage) and redirects to the homepage (frameset page www.mysite.com/
which is root)
the homepage checks for the existence of an enteredPage in the session and
builds that page in the context of the frameset--otherwise just load the
homepage.
while it takes an extra page to process, the user ends up seeing your
'pretty' url www.mysite.com/ instead of some garbage in the query
string--and they still get to where they were trying to go.
it's an idea.
have a great day,
chris
chris wilson > web developer > andrews university > www.andrews.edu
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Kevin Duffey
> Sent: Thursday, May 11, 2000 2:30 PM
> To: [EMAIL PROTECTED]
> Subject: Re: changing the response url with a dispatcher in model 2
>
>
> Couldn't agree more with Craig. Unfortanately, the only thing that is
> difficult is posting a big message that explains the site is a web
> application. I don't think most of our users even know what a web site is!
> ;) This is especially difficult for b2b sites because they want
> to maintain
> a level of professionalism that doesn't make the user feel like an idiot.
>
> I use frames as well. This way, the URL only shows the main url
> to the site.
> However, the one problem I haven't overcome yet..is if they right
> click on a
> static link and open it up in to a new window. That unfortanately bypasses
> the index.jsp page that sets up the frame, and thus they are able to
> navigate without that.
>
> Craig..any ideas?
>
>
> > > Hello
> > >
> > > I want to hide the dispatcher servlet name in the browser's
> > location bar. It
> > > would be great to only show the jsp name, without the query
> string, for
> > > example
> > >
> > > I'm afraid that it is directly handled by the browser (but
> > there might be
> > > another way), so I tried to do that with javascript, without
> > any success.
> > > The HttpServletResponse doesn't hava any method that could help.
> > >
> >
> > It is handled directly by the browser. What shows is the URL
> to which the
> > *request* was sent -- it does not come from the response. The
> > browser has no idea
> > that your dispatcher servlet forwarded the request somewhere else.
> >
> > >
> > > How do you guys who use response redirection do ? Do you show
> > the dispatcher
> > > url (which btw should be the best idea for bookmarking, but not
> > really for
> > > presentation) ?
> > >
> >
> > What I normally do is to run inside a custom window that has no
> > location bar, or I
> > use frames, even if I don't otherwise need them (in that case,
> > the app runs in one
> > very large frame, and there's a small hidden frame that isn't
> > used). That way, the
> > URL of the app itself (i.e. the page containing the frameset) is
> > the only thing
> > that shows in the location bar.
> >
> > Beyond that, it's appropriate to educate users that web
> > *applications* are not the
> > same as web *sites* -- so concepts like bookmarking and returning
> > to a particular
> > page within the app are not really useful.
> >
> > >
> > > Any idea would be greatly appreciated
> > >
> > > Sylvain
> > >
> >
> > Craig McClanahan
> >
> > ==================================================================
> > =========
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets