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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T23:46:52+00:00 2026-06-07T23:46:52+00:00

Consider we have small web application with following routes: / – return main page

  • 0

Consider we have small web application with following routes:
“/” – return main page
“/post/add/” – return new post page

we write two following controllers to handle this routes:

@Path("/")
public class HomeController {
    @GET
    @Produces(HTML)
    public String home() {
        return render(new Page(HOME_PAGE_TEMPLATE));
    }
}

and

@Path("/post")
public class PostController {

    @GET
    @Path("/add")
    @Produces(HTML)
    public String add() {
        return render(new Page(ADD_USER_PAGE_TEMPLATE));
    }
}

the problem is “HomeController” now handle all requests. How to force it to handle only “/” route?

UPD:
The solution is use @Path(“”) annotation.

  • 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-07T23:46:59+00:00Added an answer on June 7, 2026 at 11:46 pm

    The solution is use @Path(“”) annotation

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

Sidebar

Related Questions

We have a small .NET web application (aspx & ascx) that is used inside
I have what I would consider a small sized iPhone app that uses SQLite.
Consider I have the following interface: public interface A { public void b(); }
I have a small isuse regarding an interface. Consider this code: [HttpPost()] public void
I have been using the Windsor IoC Container for my web-based application, to resolve
Consider this scenario. I have a small enterprise project dev environment. We use archiva
I work at a small Web Dev firm, and have been handling all the
I have small concept problem. I am working on graph. Consider I have a
Consider the following: p1=1; p2=5; p3=7; highest=max(p1,p2,p3). The max function would return 7. I
I have following Maven projects set up: PM-Core PM-Web (with a dependency to PM-Core)

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.