Solved

need to redirect from html to servlet or jsp

Posted on 2008-06-17
5
2,685 Views
Last Modified: 2012-06-27
I am going to try to explain this problem.
I have this site that uses apache 2 and tomcat and uses a connector between the two. Apache serves up my static pages and my images.

my site has a bunch of users with their own sites and doc roots.
for example.
http://www.mydomain.com/kam
http://www.mydomain.com/sue
http://www.mydomain.com/fred

i have lots of users.
in order to distribute the directories alittle and not have 1000's of users all under one directory i do mod-rewrite with apache.
for example

http://www.mydomain.com/kam
the doc root is /home/docroot/k/kam
http://www.mydomain.com/fred
the doc root is /home/docroot/f/fred

So hopefully you see the pattern.

one more note, apache understands the mod-rewrite, but tomcat obviously does not.

so here is my problem

in the frames world i do the following (this would be the index.html in /home/docroot/k/kam/index.html
and they would get to it by http://www.mydomain.com/kam

<HTML>
<HEAD>
<META HTTP-EQUIV=Expires CONTENT="Tue, 04 Dec 1993 21:29:02 GMT">
<TITLE>kam 's Page</TITLE>
</HEAD>
<FRAMESET MARGINWIDTH=0 MARGINHEIGHT=0 FRAMEBORDER=NO BORDER=0  ROWS="100%,0">
<FRAME NORESIZE SCROLLING="auto" NAME="title" MARGINWIDTH=0 MARGINHEIGHT=0 NORESIZE SRC="/servlet/publicServlet?method=showMembersPage&id=965&lang=0" TARGET=_top>
</FRAMESET>
</HTML>

So i want to get rid of the frames.

so what i have working now is in my index.html
<html>
<head>
<META HTTP-EQUIV=Expires CONTENT="Tue, 04 Dec 1993 21:29:02 GMT">
<meta http-equiv="refresh" content="0;url=/servlet/publicServlet?method=showMembersPage&id=965&lang=0">
</head>
</html>

i was going to have an index.jsp but that would mess up everyones URLS because instead of
http://www.mydomain.com/kam(implied /index.jsp)
they would have to do because tomcat does not recognize the mod_rewrite.
http://www.mydomain.com/k/kam

So what i am asking is for a more elegant solution, if there is one.

I hope this makes sense







0
Comment
Question by:paries
  • 2
5 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 21811854
You can still use a JSP if you redirect from the original index.html to a index.jsp. In your /home/docroot/k/kam/index.html you could have something like

<meta http-equiv="REFRESH" content="0;url=http://www.mydomain.com/kam/index.jsp">

and the index.jsp should be the page without farmes.
0
 

Author Comment

by:paries
ID: 21812337
thats,
actually the index.jsp would do a couple of env checks and call
/servlet/publicServlet?method=showMembersPage&id=965&lang=0, just like index.html

so i guess what you are saying is that the meta refresh is really the only option

0
 
LVL 35

Accepted Solution

by:
girionis earned 500 total points
ID: 21812466
> thats,
>actually the index.jsp would do a couple of env checks and call
>/servlet/publicServlet?method=showMembersPage&id=965&lang=0, just like index.html

Yes

> and the index.jsp should be the page without farmes.

it's the easiest and quickest option.
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question