Giter VIP home page Giter VIP logo

bowler's People

Contributors

greenrd avatar noelkennedy avatar thesmith avatar wfaler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bowler's Issues

Better handling of StringValueTransformers

Currently, if you forget to register a StringValueTransformer, you just get a default value of the type to be transformed for an argument of that type. This is undesirable.

Scaml and Jade cannot be loaded

When trying to use Scaml or Jade templates I get the following exception:

org.fusesource.scalate.InvalidSyntaxException: string matching regex \r?\n' expected but!' found at 1.24
at org.fusesource.scalate.scaml.ScamlParser.parse(ScamlParser.scala:375)
at org.fusesource.scalate.jade.JadeCodeGenerator.generate(JadeCodeGenerator.scala:38)

This bug is likely caused by the way these files are loaded from the classpath by the com.recursivity.commons.StringInputStreamReader util, which simply concats all lines effectively stripping the newlines.

Allow request forwarding

In Java, you can do request.getRequestDispatcher(new_url).forward(request, response) to forward requests (rather than redirect) which is very useful if you are setting values in the request rather than session. Please add this functionality to the BowlerHttpRequest class.

Documentation improvements

There are some things in Bowler that are currently undocumented. I would appreciate some guidance from @wfaler on this issue, as it's possible some features are "unfinished".

I should probably also go through the closed issues and consider if any of them indicate something missing in the docs.

Could not download sbt 0.7.5.RC0

Getting org.scala-sbt sbt 0.7.5.RC0 ...

:: problems summary ::
:::: WARNINGS
                module not found: org.scala-sbt#sbt;0.7.5.RC0

        ==== local: tried

          /home/robin/.ivy2/local/org.scala-sbt/sbt/0.7.5.RC0/ivys/ivy.xml

        ==== typesafe-ivy-releases: tried

          http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.7.5.RC0/ivys/ivy.xml

        ==== Maven Central: tried

          http://repo1.maven.org/maven2/org/scala-sbt/sbt/0.7.5.RC0/sbt-0.7.5.RC0.pom

        ==== sonatype-snapshots: tried

          https://oss.sonatype.org/content/repositories/snapshots/org/scala-sbt/sbt/0.7.5.RC0/sbt-0.7.5.RC0.pom

                ::::::::::::::::::::::::::::::::::::::::::::::

                ::          UNRESOLVED DEPENDENCIES         ::

                ::::::::::::::::::::::::::::::::::::::::::::::

                :: org.scala-sbt#sbt;0.7.5.RC0: not found

                ::::::::::::::::::::::::::::::::::::::::::::::



:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-sbt#sbt;0.7.5.RC0: not found
Error during sbt execution: Error retrieving required libraries
  (see /home/robin/.sbt/boot/update.log for complete log)
Error: Could not retrieve sbt 0.7.5.RC0

Strange error if StringValueTransformer returns None

If a registered StringValueTransformer returns None, bowler tries to call the method with None as argument, even if its formal parameter is not of type Option[T]. This results in an exception from inside java.lang.reflect which is not clear as to what the real problem is.

JSON arbitrarily renders empty json on persistent objects

It seems that the JSON renderer arbitrarily renders empty JSON objects some of the time for case classes that are retrieved from a persistent store with JPA or Squeryl.

The two common denominators seem to be:

  • Persistent storage in Squeryl or JPA with the JPA extensions
  • case classes that have a secondary no-args constructor

I initially thought it was the no-args constructor that was the issue, but it seems that it is a mix of the issues that somehow collude - no-args constructors are fine on non-persistent objects.

This is probably a lift-json library issue, however if that is the case, maybe replacing it is an option with another implementation of JsonViewRenderer

Should not depend on slf4j-nop

per the slf4j documentation, slf4j implementations are only for applications, not for frameworks.

This issue breaks testing with ScalatraSpec, because no stack traces are available when something goes wrong in a test.

Design review

As @wfaler has previously mentioned he was thinking about these things: Is there anything that might be better off folded into Scalatra? Is there anything that should be removed and replaced with similar functionality in Scalatra (or even possibly the Java Servlet API)?

Any other design issues?

Comments welcome!

Note: Personally I want to support running on Servlet API 2.5 and above in a putative future Bowler Framework 1.0, but that may change (based on feedback from users or my requirements changing).

Uploading files that is smaller than 10kb

Hi

We have an issue with bowler and file uploads. It looks like files that are uploaded that are larger than 10kb is saved and there path is stored inside the StoreLocation "variable" of the string that comes into our action. With these large files the file is ok and can be read.

However if the file uploaded to Bowler is less than 10kb the path inside of StoreLocation is pointing to a file that does not exists. I there for get a FileNotFound exception.

The file that is uploaded should be properly saved to the path, and should be able to be read.

These are my versions;
"org.bowlerframework" %% "core" % "0.5.1",
"org.slf4j" % "slf4j-nop" % "1.6.0" % "runtime",
"javax.servlet" % "servlet-api" % "2.5" % "provided",
"org.eclipse.jetty" % "jetty-webapp" % "7.4.2.v20110526" % "container",
"org.eclipse.jetty" % "jetty-webapp" % "7.4.2.v20110526",
"org.scalatra" %% "scalatra-scalatest" % "2.1.0-SNAPSHOT" % "test",
"org.specs2" % "specs2_2.9.0" % "1.3" % "test",
"net.liftweb" %% "lift-json" % "2.3" % "test",
"net.java.dev.jets3t" % "jets3t" % "0.8.1",
"org.scala-tools.time" %% "time" % "0.5",
"org.bowlerframework" %% "squeryl-mapper" % "0.5.1",
"com.h2database" % "h2" % "1.2.144",
"c3p0" % "c3p0" % "0.9.1.2",
"org.squeryl" %% "squeryl" % "0.9.5-RC1",
"postgresql" % "postgresql" % "8.4-701.jdbc4",
"org.imgscalr" % "imgscalr-lib" % "4.1",
"net.databinder" %% "dispatch-http" % "0.8.7"

Slash forward

Deal with slash forward and lack of slash equally (append slash/remove slash on additional route)

Dots (".") in paths in FunctionNameConventionRoutes do not work

Application crashes during startup when a . is in the path of a route in FunctionNameConventionRoutes.
This is likely due to dots not being translated during startup when routes are reflectively read ("." needs to be translated into it's JVM "$something")

Content-type issues

I'm not sure what the root problem is here, but there is odd behaviour around content-types and the accept header. I have a resource at /foo which accepts GET and returns a json response, by calling render(my_case_class_instance). There is no HTML view (.mustache, etc) for that resource.

Wrong content-type returned

If I make a request with:
Accept: application/json

I get back my JSON representation, but with a Content-type header of text/plain (bug #1?)

Incorrect HTTP status when no suitable content-type available

If I make a request with:
Accept: text/plain or Accept: text/html

Then, I get an error 500 from the service, with the message Could not find a template of type .html, .xhtml, .xml, .mustache, .ssp, .jade or .scaml with path: classpath:///views/GET/foo (bug #2?)
I would expect to get 406 here, although I have not specified in code that application/json is the only content-type I can produce, that is how imagine the resource to be defined. (side issue: how do I specify in code what content-type I am producing?)

Incorrect matching of wildcard Accept headers

If I make a request with:
Accept: */* or
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 (chrome default)

Then, I get an error 500 from the service, with the message Could not find a template of type .html, .xhtml, .xml, .mustache, .ssp, .jade or .scaml with path: classpath:///views/GET/foo (bug #3?)
As these both accept */*, I expect the json representation to be returned.

These 3 situations seem to be connected, but if you would rather I raise 3 separate bugs, I can do that.

ValidationErrors not returned if there is no previous GET URL

From the mailing list:
My scenario is of someone following an "expired" link from another
website, email, bookmark...
But this can be any invalid request that comes from somewhere else so
there is no previous GET URL.
What I would like to do is to use the validationErrors in the view of
the current request. Or to be able to set the view that will display
the validationErrors

Flash map / flash cookie support

The idea is that you have ephemeral state which only exists for the next request and is then deleted. This can be used for e.g. redirecting to another page and displaying a "success" widget - the success message would be stored in the flash map / flash cookie.

A problem with this (at least, as they are implemented in Play 2.0.1) is it doesn't play well with multiple tabs being used by the same user at the same time.

Scalatra does already have a flash map implementation but I'm unclear on how this could be used from Bowler.

POST is incorrectly allowed on GET-only resource

With this minimal Controller:

class MyController extends Controller with Renderable {
 get("/widget")((request, response) => {
    render( some_json_thing )
  })
}

Attempts to POST to that resource result in a 404. Also, OPTIONS on that resource returns:

Content-Length: 0
Server: Jetty(6.1.22)
Allow: GET, HEAD, POST, TRACE, OPTIONS
Content-Type: text/plain; charset=utf-8

I think that POST should result in 405 and should not be in the Allow header.

IllegalArgumentException - setLastPath for first request

Hey, I've been getting the following IllegalArgumentException:

java.lang.IllegalStateException
at org.eclipse.jetty.server.session.AbstractSessionManager$Session.setAttribute(AbstractSessionManager.java:1186)
at org.bowlerframework.http.BowlerHttpSession.setLastGetPath(BowlerHttpSession.scala:43)
at org.bowlerframework.view.scalate.ScalateViewRenderer.render(ScalateViewRenderer.scala:34)
at org.bowlerframework.view.scalate.BrowserViewRenderer$class.renderView(BrowserViewRenderer.scala:52)
at org.bowlerframework.view.scalate.ScalateViewRenderer.renderView(ScalateViewRenderer.scala:10)
at org.bowlerframework.view.Renderable$class.renderSeq(Renderable.scala:67)
at org.bowlerframework.view.Renderable$class.render(Renderable.scala:60)

This only happens on the first request for a user, so I assume it's complaining about there being nothing to set. For this, I'm using the FunctionNameConventionRoutes and jetty-7.4.1.v20110513.

Hope that's enough information!

Configuration setting to drop HTTP method from view path

Want to be able to (in one line of code) drop GET, POST etc. from the view path, for applications which follow a design of using the same view for GETs and POSTs to the same URL (when they render anything at all for that URL, as opposed to sending e.g. a redirect or a HTTP error).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.