Solved

need to redirect from html to servlet or jsp

Posted on 2008-06-17
5
2,595 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 9 71
Redirect and Rewrite URL using .htaccess 38 95
maven java path setting 5 50
WCAG audit tools 1 51
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…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now