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

  • Home
  • SEARCH
  • 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 8481153
In Process

The Archive Base Latest Questions

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

I am using the framework Play 2.0 with Java I have some html <div>my

  • 0

I am using the framework Play 2.0 with Java
I have some html

<div>my html</div>

in a file test.html

Is there anyway I can access the html in another file (say main.html)?
Maybe through some global variable

I tried to surround my html with

@variable{<div>my html</div>}

Then access it from main.html using

@variable

But this didn’t work…

Any ideas?

  • 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-10T19:29:15+00:00Added an answer on June 10, 2026 at 7:29 pm

    Templates are basically functions as stated in the link that szegedi mentioned.
    I think what you want is called tags in Play. Basically you have a file with some HTML: let’s say a progress bar:

    @(progressPercentage : Int) // define input params for this view/function
    
    <div class="progress progress-success progress-striped active">
        <div class="bar" style="width: @progressPercentage%;">@progressPercentage%</div>
    </div>
    

    The file above is called progress.sacala.html and save in views.tags.graphs

    The you can access or call this piece of HTML by entering the following in one of your views:

    @tags.graphs.progress(yourPercentageVar)
    

    Of course you can do it without passing any variable, but I thought it would be nice to include the vars as well. Good luck!

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

Sidebar

Related Questions

iam using AVFoundation Framework to play mp3 file ,everything works great ، i have
i am using guice with java play framework. i have a simple command interface,
I am using Play Framework 2.0.1. I have created a Java application using the
How can I join two tables by using java play framework and jpa, I
Writing a Java application using the Play framework and need some HTTP-Live streaming. I
I want to perform some AJAX style data retrieval using the Java Play Framework
I am using Play Framework 2.0 with Scala. So I have an action that
I'm trying to test a model method using Play Framework 2.0 and Specs2. Global.scala
I have a Play Framework application that sends emails using SMTP server. Now I
I have a small site I built using the Play framework that I'm trying

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.