Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

need to redirect from html to servlet or jsp

Posted on 2008-06-17
5
Medium Priority
?
2,838 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 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

721 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