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 4059566
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:13:32+00:00 2026-05-20T15:13:32+00:00

I have a Spring MVC application (version 3.0.5.RELEASE) and I have this in my

  • 0

I have a Spring MVC application (version 3.0.5.RELEASE) and I have this in my mvc-config.xml:

<mvc:view-controller path="/" view-name="welcome"/>

So requests to “/” are forwarded to the welcome view welcome.jsp.

This means in my case, calling the URL http://myproject-test.mydomain.com/ will forward to the welcome.jsp. It’s fine, but I have to extend it. Besides the URL http://myproject-test.mydomain.com/, I have the URL http://myproject-anothertest.mydomain.com/. With this URL, the whole application should be the same, except the welcome page.

Calling http://myproject-anothertest.mydomain.com/, I want to have the welcome-test.jsp page instead of the welcome.jsp.

So, how can I do this? I have to know from which subomain (myproject-test or myproject-anothertest) the user calls the site and then show him welcome.jsp or welcome-test.jsp.

Does anyone know how this can be done?

Thank you in advance & Best Regards, Tim.

  • 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-05-20T15:13:32+00:00Added an answer on May 20, 2026 at 3:13 pm

    The tag <mvc:view-controller> maps to ParameterizableViewController

    You could inherit your own controller class from its parent, AbstractController, and use the request parameter in method handleRequestInternal to deduce which hostname is being used to access your page, then use the appropriate view.

    HTTP request header Host contains (if using HTTP/1.1) the “virtual” server name that is being used to access your page. Older HTTP/1.0 protocol does not have the Host header, and some proxies map traffic to HTTP/1.0, in that case you will not be able to distinguish between the traffic using different names.

    In JSP, you could use <%=request.getServerName()%> to access the Host header value. See doc for getServerName.

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

Sidebar

Related Questions

I have a spring MVC application using JSP as my view technologies with Jquery
I have read this tutorial to write my hello world application with spring mvc.But
I have a Spring MVC application trying to use a rich domain model, with
I have a Spring Web MVC application that I'd like to serve a large,
I am using Spring MVC to build my web application, and I have a
I have a controller (Spring-MVC) that generates a PDF report on a get request.
I have a website that uses JSP as its view technology (and Spring MVC
I basically have the following flow: XML -> JSON -> Spring MVC -> jsp
I have a small Spring (3.1.0.RELEASE) application, which was working just fine, until I
I am developing my application using spring-web-mvc... Now at my Controller it returns like

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.