Questions tagged [sitebricks]

A fast, light platform for web development.

Sitebricks is a simple set of libraries for web applications. Sitebricks focuses on early error detection, low-footprint code, and fast development. Powered by Guice, it also balances idiomatic Java with an emphasis on concise code.

37 questions
6
votes
1 answer

Method interception or validation of request params in Sitebricks controller

I'm using Sitebricks with Guice to implement REST service and I have a set of methods like this: @Get @At("/:version/har/mostRecentEntry/assertResponseTimeWithin") public Reply doSomething(@Named("version") int version, Request request)…
XZen
  • 225
  • 5
  • 27
  • 49
6
votes
1 answer

Use Guice Injection in a Java GAE Backend Servlet

I have a dilemma in my GAE Java app: I am trying to write a servlet that will be handled by GAE backends and it must also use Guice dependency injection to initiate all the servlet's fields. I have tried multiple approaches but none seems to be…
ecbrodie
  • 11,246
  • 21
  • 71
  • 120
6
votes
1 answer

Is there a well-typed Scala (or Java) library to consume JSON Web APIs?

I want a simple rest client library for Java (or Scala) that let's me easily do GETs/PUTs/POSTs/DELETEs etc on a JSON REST API and deserialize the JSON responses into Java objects in a type-safe way e.g. RestClient client = new…
pathikrit
  • 32,469
  • 37
  • 142
  • 221
3
votes
1 answer

Google Sitebricks Session Management

I explored Sitebricks website and related forums but could not find out if it supports session management (preserving state across multiple requests) or not. Just wondering if anyone knows the answer to this?
Abidi
  • 7,846
  • 14
  • 43
  • 65
3
votes
1 answer

How to inject request-scoped HttpSessions in sitebricks methods on GAE?

I have the following sitebricks servlet. Foo.get() is accessible as a GET at /foo/bar. I deployed the servlet to GAE. @Service @At("/foo") @Singleton public class Foo { @Get @At("/bar") public Reply bar(Request request, HttpSession…
Ingo
  • 1,552
  • 10
  • 31
2
votes
0 answers

Two sitebricks services using different HTTP method but with same URL depth, client gets 404

When in the same sitebricks service class '@At("/r/address/streets")' '@Service' have two services like : '@At("/search") '@Post' '@At("/:id")' '@Delete' The client gets 404 r/address/streets/search not found But there should not have problems…
2
votes
1 answer

Guice 4.0-beta5 doesn't work with Sitebricks 0.8.10

I just tried to deploy to GAE the sample HelloWorld app on Sitebricks website, using the latest versions of Guice and Sitebricks (4.0-beta5) and (0.8.10) and the injection fails. The is what the Google App Engine log shows: Uncaught exception from…
2
votes
0 answers

How to automate retrieval of DTOs from Sitebircks service

Is there any way that automated DTO retrieval like this can be achieved but with sitebricks services. I'm searching for solutions where this: @Post public Reply post(Request request) { DTO dto = request.read(DTO.class).as(Json.class); //some…
2
votes
2 answers

How to make browser download json returned from rest service

The frameworks i'm using are AngularJS(client-side) and Sitebricks(server-side). I want to return a list of objects into json and make the client download that json by prompting the user where he wants to save the file. I accept all kind of…
Tek
  • 1,178
  • 1
  • 12
  • 22
1
vote
1 answer

Can sitebricks be configured to not say "Sitebricks received a null reply from the resource..."?

In some error cases including the one above Sitebricks adds a stack trance to the response. This is a security issue with leaking information. We plug the problems we find but is there a way to tell site bricks never to send stack traces?
Usman Ismail
  • 17,999
  • 14
  • 83
  • 165
1
vote
2 answers

Is there a way to get post parameters from a http request in a filter but keep the input stream intact for servlet?

I am trying to fix a bug in sitebricks where it consumes the input stream in of the data of all servlets even those not using site bricks. HiddenMethodFilter.java line:66 String methodName = httpRequest.getParameter(this.hiddenFieldName); See…
Usman Ismail
  • 17,999
  • 14
  • 83
  • 165
1
vote
2 answers

Sitebricks HTML files

HTML files in Sitebricks need to have same name as Models and they should exist in WEB-INF or in the same directory as models. Just wondering is there a way to better organise HTML files. For example keeping them in separate folders? Currently if I…
Abidi
  • 7,846
  • 14
  • 43
  • 65
1
vote
1 answer

How to test Reply in sitebricks

I am using sitebricks and I have to test Reply using jmock, but the object is not interface, so i cannot mock it. Here is some code: @Get Reply view() { return Reply.with(new Product("Anti-ageing cure")) .as(Json.class); } The…
LanMan
  • 211
  • 1
  • 3
  • 9
1
vote
1 answer

How to exclude a URL when registering filters in ServletModule.configureServlets?

I use sitebricks to build a RESTful API on Google App Engine. I register two filters for all /rest/* URLs in my GuiceCreator. How can I use the filter("/rest/*) syntax but exclude one specific URL? I want that everything under /rest/* gets filtered…
Ingo
  • 1,552
  • 10
  • 31
1
vote
1 answer

Is Sitebricks compatible with GAE backends (Java)

I would like to know whether it is possible to host a Google App Engine backend servlet using Sitebricks. I am trying to do so in my GAE Java app -- frontend gets the backend URL using GAE's BackendService interface and send an HTTP Request -- but…
ecbrodie
  • 11,246
  • 21
  • 71
  • 120
1
2 3