Solved

need to redirect from html to servlet or jsp

Posted on 2008-06-17
5
2,776 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
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…
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…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

624 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