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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:24:33+00:00 2026-06-18T10:24:33+00:00

I was trying to create a Controller inheritance to check how does Interceptions work.

  • 0

I was trying to create a Controller inheritance to check how does Interceptions work.

The default controller i.e. Application.java is like this:

@Before
static void display(){
    System.out.println("Interception method \"Before\" invoked!!!");
}

public static void index() {
    System.out.println("Inside index!!!");
    render();
}

I created a new controller named App.java and it is like this:

@With(Application.class)

public class App extends Controller {

public static void welcome(String txtName){
    render(txtName);
}

}

Here is the index.html file:

#{extends 'main.html' /}
#{set title:'Home' /}

<form action="@{App.welcome()}" method="get">
Enter your name: <input type="text" name="txtName">
<input type="submit" value="Submit">
</form>

This is Welcome.html file:

#{extends 'main.html' /}
#{set title:'Home' /}

Welcome ${txtName?:'Guest'}

I added this entry in routes file:

GET     /InterceptionDemo                       controllers.App.welcome

When I enter the name and click the button in index.html then I am getting an error:

The template App/welcome.html does not exist.

I am trying to use the App.java controller but it is not working. The welcome.html file is present under the views/Application folder where the index.html is also present.

Please let me know how to make it work…this is just a junk app trying it out for getting started with Play framework inheritance.

Thanks.

  • 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-18T10:24:34+00:00Added an answer on June 18, 2026 at 10:24 am

    Tried your example, and it worked just fine. Placed the Welcome.html file in the wrong directory, and got the same error as you. But then created the views/App directory and placed it there, and it worked.

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

Sidebar

Related Questions

I am trying to create a function like public static TResponse Run<TService, TResponse>(Controller mvcController,
I'm trying to create a controller to upload photos in my MVC4 application. But
I am trying to create a Single Table Inheritance. However, the Controller must be
I'm trying to create a multiaction web controller using Spring annotations. This controller will
I'm trying to create a custom helper like this: # app/controllers/my_controller.rb class MyController <
I'm trying to understand how does the inheritance work in play! But unsuccessfully yet.
hi i am trying to create a URL that looks like this: black/granite/worktops where
I'm trying to create a controller inside a module using the Zend_Tool doing this:
I am trying to create this controller: def calculate # Do some calculations here
I'm trying to create a container view controller using iOS5 and new methods 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.