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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:25:42+00:00 2026-06-17T19:25:42+00:00

In the page login.jsp, the value of the variable title cannot be transferred to

  • 0

In the page “login.jsp”, the value of the variable “title” cannot be transferred to the title tag in the “default.jsp” page, more specifically the code “arguments”. When I visit the login url, the page’s title is actually “{0} – CompanyName”. That’s incorrect, it should be “Login – CompanyName”. Please help.

----layout/tiles.xml----
<tiles-definitions>
    <definition name="default" template="/WEB-INF/views/layout/default.jsp">
        <put-attribute name="header" value="/WEB-INF/views/layout/header.jsp" />
        <put-attribute name="footer" value="/WEB-INF/views/layout/footer.jsp" />
    </definition>
</tiles-definitions>

----users/tiles.xml----
<tiles-definitions>
    <definition extends="default" name="users/login">
        <put-attribute name="body" value="/WEB-INF/views/users/login.jsp" />
    </definition>
</tiles-definitions>

----layout/default.jsp----
<head>
    <title><spring:message code="title" arguments="${title}" />
</title>
</head>
<body>
    <tiles:insertAttribute name="header" ignore="true" />
    <tiles:insertAttribute name="body" />
    <tiles:insertAttribute name="footer" ignore="true" />
</body>

----users/login.jsp----
<spring:message code="title.login" var="title" />

----layout.properties----
title = {0} - CompanyName
title.login = Login 
  • 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-17T19:25:44+00:00Added an answer on June 17, 2026 at 7:25 pm

    Fixed. When visit url “/login”, the title shows “Login – CompanyName”. When visit “/blogs/123”, the title is “Name123 – Blog – CompanyName”. Perfect solution!

    ----servlet-context.xml----
    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
        p:fallbackToSystemLocale="false"
        p:basenames="WEB-INF/i18n/layout" />
    
    ----layout.properties----
    title = {0} - CompanyName
    title.login = Login
    title.blog = {0} - Blog
    
    ----AccessController.java----
    @Autowired
    MessageSource messageSource;
    
    @RequestMapping("/login")
    public String login(Model model, Locale locale) {
        model.addAttribute("title",
                messageSource.getMessage("title.login", null, locale));
        return "access/login";
    }
    
    ----BlogController.java----
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    public String show(@PathVariable("id") Long id, Model model, Locale locale) {
        Blog blog = blogService.findById(id);
        model.addAttribute("title", messageSource.getMessage(
                "title.blog", new Object[] { blog.getName() },
                locale));
        return "blogs/show";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created Aspx login page and ext js login form in it ExtJs code
I try to create login form in web application. in JSP page I can
can i use hibernate to login jsp page using (session) if i'm not using
i am building a login page using HTML and JSP. But every time i
I have made small web-app in jsp with a start page with login and
I ll explain my problem with an example. In my JSP login page ,
I have a login.jsp page: <form method=post action=url:8081/login.xhtml> Username : <input type=text name=txtUsername/> Password
In the first line of my JSP page, I check for a session value
I have a JSP application that connects to oracle on the log in page.
In my login page I creat FA cookie. I want to add to it

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.