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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:46:04+00:00 2026-06-09T09:46:04+00:00

I have the following play2 code: implicit def contextToRequest(rc: RequestContext[_]) = rc.request implicit def

  • 0

I have the following play2 code:

  implicit def contextToRequest(rc: RequestContext[_]) = rc.request
  implicit def contextToFlash(rc: RequestContext[_]) = rc.request.flash
  implicit def contextToSession(rc: RequestContext[_]) = rc.request.session

  def login: Action[AnyContent] = PublicAction { implicit rc =>
    Ok(html.login(loginForm))
  }

RequestContext is my own custom class wrapper of the Play2 Request.

My scala view starts with:

@(form: Form[(String,String,Boolean)])(implicit flash: Flash, session: Session,rc: utils.RequestContext[_])

But the compiler says:

could not find implicit value for parameter flash: play.api.mvc.Flash

Can someone explain to me why it doesn’t work?
Perhaps we can’t use implicit conversions for implicit parameters?

Then can someone explain to me why there is already a working implicit conversion from the Play2 request to Session/Flash and when I do it it doesn’t work?

  • 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-09T09:46:07+00:00Added an answer on June 9, 2026 at 9:46 am

    When you end up having multiple implicit parameters, some of which are members properties of the others, there is something wrong in your design.

    class B
    class C
    
    class A {
      val b:B = _
      val c:C = _ 
    
    }
    
    def myMethod(someData:String)(implicit a:A, b:B, c:C) {
    
    }
    

    In fact, what you want to have inside your method are the B and the C members of that A. However, with such a signature one can provide a given A and a B and a C which have nothing to do with that A. The right signature would be the following

      def myMethod(someData:String)(implicit a:A) {
        // trick to import members variable
        import a._
        println(b)
        println(c)
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which creates an ImageButton and plays a sound when
I have the following code for Android which works fine to play a sound
I have following code in initialization im = imread('Image02.tif'); figure(); imagesc(im); colormap(gray); [hImage hfig
I have the following code i am trying to get the play speed rank
I have the following code, and it works fine until i hit the the
I have the following code: $('a.home-page-link').mouseover(function() { $(this).animate({ opacity: 0.4 }, 200, function()); });
I have the following code which downloads video content: WebRequest wreq = (HttpWebRequest)WebRequest.Create(url); using
I have the following code that triggers two functions whenever a button is clicked.
I have the following code: public void Dispose() { if (_instance != null) {
I have the following code: AssetFileDescriptor afd = getAssets().openFd(AudioFile.mp3); player = new MediaPlayer(); player.setDataSource(afd.getFileDescriptor());

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.