Mixing scala and java in Play Framework

后端 未结 4 1067
耶瑟儿~
耶瑟儿~ 2021-01-06 04:53

I have a Java file that looks like this:

package AuthorizeNetFingerprint;


class Fingerprint {
    private static Log logger = LogFactory.getLog(Fingerprint         


        
4条回答
  •  爱一瞬间的悲伤
    2021-01-06 05:01

    It's conventional to name Java packages in all lower case.

    It also appears that Scala gets confused if you try to use a Java package that starts with upper case. If you use authorize as the package name instead of AuthorizeNetFingerprint, it will compile.

    Also, there's no need for this:

    val fingerprint = new AuthorizeNetFingerprint.Fingerprint 
    

    createFingerprint is a static method, so just call

    val x_fp_hash = Fingerprint.createFingerprint
    

    (after importing authorize.Fingerprint).

提交回复
热议问题