Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8827941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:29:36+00:00 2026-06-14T07:29:36+00:00

In my application, user can subscribe to different clubs like for example Kid club,

  • 0

In my application, user can subscribe to different clubs like for example Kid club, Youth club, Adult club and Elderly club. Now, suppose if user is already subscribed to Kid club on 7th October 2012 and if he again tries to subscribe the same club “Kid Club” on 2nd November 2012 then we try to redirect that user to another club such as Youth Club OR Adult Club OR Elderly Club. Each club has it’s own domain such as (For example)

Kid club = kidclub.google.mobi
Youth Club = youthclub.yahoo.mobi
Adult Club=adult.godaddy.mobi
Elderly Club = elderly.google.mobi

Following is the sample code for redirection but this is not redirecting to different domain URL. Is it due to sendRedirect () method?Servlet is not used in this application. Only JSP is used with MySQL database in Apache Tomcat Server Please suggest asap.

 void doRedirect(HttpServletResponse response, String url)
    {
    try 
    {
    response.sendRedirect(url);
    }
    catch (Exception e) 
    {
    e.printStackTrace()
    }
    }

    void redirectReturningUser( HttpServletRequest request, HttpServletResponse
    response, ClubDomain currentDomain )
    {
    String redirectToUrl = currentDomain.getDefaultUrl();

    if( "kidclub.google.mobi".equals( currentDomain.getDefaultUrl() ) )
    redirectToUrl = "youthclub.yahoo.mobi";
    else if( "adult.godaddy.mobi".equals( currentDomain.getDefaultUrl() ) )
    redirectToUrl = "kidclub.google.mobi";
    else if( "youthclub.yahoo.mobi".equals( currentDomain.getDefaultUrl() ) )
    redirectToUrl = "adult.godaddy.mobi";
    else if( "adult.godaddy.mobi".equals( currentDomain.getDefaultUrl() ) )
    redirectToUrl = "elderly.google.mobi";
    else if( "elderly.google.mobi".equals( currentDomain.getDefaultUrl() ) )
    redirectToUrl = "adult.godaddy.mobi";

    doRedirect(response, "http://"+redirectToUrl );
    }

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:29:37+00:00Added an answer on June 14, 2026 at 7:29 am

    response.sendRedirect(url); works with relative (without http:) and absolute URLs, so the problem must be elsewhere.

    The most common cause of problems is that some other code already started to write output to the response using getOutputStream() or getWriter(): As soon as the first byte is written that way, the HTTP header (which contains the redirect information) will be generated and send to the browser.

    So you should look into catalina.out because the e.printStackTrace() was probably called.

    You might also want to check what currentDomain.getDefaultUrl() returns; maybe the ifs above simply never match.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application user can share information with different apps using: shareIntent.putExtra(Intent.EXTRA_SUBJECT, Link from
In my application user can add there reminder for the specific day and reminder
In my application user can create post,however only the creator of the post can
In my application the user can drag and drop multiple text files onto a
I'm writing an application where user can point a position in a Google Maps
I'm making a small tool application that user can minimize in the taskbar .
I am building an application where the user can save some information into an
I have an application where the user can write up some questions and add
I have a application whereby a user can destroy other users attached to the
I have an view-based application where the user can do a lot of customization

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.