Sorry for my bad english!
I'm a newbie in Scala language, I get a project and error with some modifications
"Scala is not a member of value ... Can some body help me? follow my code:
Kmmandःskla
package Comkbaila Simskdomen import Skalakalekshnkmap import redis.clients.jedis.Jedis seal featuring CommandResult object success CommandResult object Failure extends commandResult objection unauthorized spread extends CommandResult attribute command {def captchaValidator: Validator def logger: logging Val property = PropertiesHandler.readProperties (System.getProperty (PropertiesHandler.configFileNameKey))}
RedisIcrementCommand.scala
package com .bla.cms package domain import scala.collection.Map import redis.clients.jedis.JedisPool import dispatch._ import org.apache.log4j.Logger import redis. clients.jedis.Jedis class RedisIncrementCommand (database: Jedis, Val captchaValidator: Verifier, Val logger: log) Spread the command {exec} (parameter: map [string, string]): CommandResult = {match = {captchaValidator.validate (parameter) match {case correct (foot Ms) = & gt; ExecuteInDatabase (case) case left (position) = & gt; LogFinder.get ("Selected Answers") match {string, string} Case some (selected enter) = & gt; Database.incr (Selected Answers) database.sadd (answer, selected enter), logger.info ("can get increase." Option: "+ Enter selected") no case of success => Logger.info ("Falha ao tantar computar incremento. Alternativa não informada.")}}}
PollServle.scala
package com.bla .cm import javax .servlet.http._ import redis.clients.jedis.JedisPool import scala.collection.JavaConverters._ import scala.collection.JavaConversions._ import com.bla.cms.domain.Logging import org.apache.log4j. logger import scala .util.matching.Regex class PollServlet RequiresConnection {Importing com.bla.cms.domain._HttpServlet extends with URLHandler._de F. doPost override (request: HttpServletRequest, responded: HttpServletResponse): Unit = {val parametersMap = new ServletApiAdapter (request, response). Parameter VAL results = new Inkrent Command (request). Execute (Paramitrmap) redirect (request, response, results) }}
And when I compile, I found:
[error] PollServlet.scala: 19: execute com.bla value. Cms.domai is a member member
You can do the following:
< Li> command
properties
-
NewIncrease Commands (request )
to redisIncrementCommand
change like . I like the one that will:
Properties command {val Captcha Validetetr: validator Val logger: logging Val property = PropertiesHandler.readProperties (System.getProperty (PropertiesHandler.configFileNameKey ) Define Def (parameter: Map [String, String]): CommandResult Def executeInDatabase (Parameter: Map [String, String]): CommandResult}
No comments:
Post a Comment