spark-java Questions

6

Having been in .NET, I am well versed in the support that micro web frameworks such as NancyFX and Web API have for IoC containers. In similar frameworks in Ruby like Sinatra (NancyFX is based on ...
Bolometer asked 19/8, 2015 at 4:14

1

I am trying to learn spark java web framework. I am using Intellij and created a new project just added a HelloWorld class, but got this error, Build file '/Users/mingwang/SourceCodes/spark-example...
Palazzo asked 3/5, 2021 at 9:8

5

I'm pretty new with all these things but hope that you guys can help me understand how does it work. I got a form with field . How do i get data from client back? Was looking for some information b...
Measures asked 28/3, 2015 at 0:1

2

Solved

I'm new to sparkjava. I want to read my request params using spark java but I'm not able to find the correct syntax. please help me out. Below is my route method and the client call to it: my cli...
Overshoot asked 18/3, 2015 at 16:29

4

Solved

I am new to sparkjava and like it overall. However, do new routes/endpoints have to be defined in the main method? For any significant web application, this will result in a very long main method o...
Posterity asked 24/1, 2016 at 13:38

4

Solved

I used spark web framework to create a webapp, but I don't know how to deploy this webapp. I'm sorry if this is very basic, but I'm new to spark framework and I cannot find any document that guide ...
Tarragon asked 5/11, 2013 at 7:17

3

Solved

Is there any way to run multiple instances of Sparkjava server in the same JVM? I am using it in a "plugin" software and based on external circumstances multiple instances of my plugin might be sta...
Horten asked 3/1, 2017 at 20:52

7

Solved

Does anyone know how to override existing 404 error page when using Spark micro web framework ? The default error page is: <html> <head> <meta http-equiv="Content-Type" content="te...
Savina asked 1/11, 2013 at 16:47

4

I want to do something to sign up users with spark+java+hibernate+postgres This is my code: post("/registrar", (request, response) -> { EntityManagerFactory emf = Persistence. createEntityM...
Tavie asked 18/9, 2015 at 3:44

2

Solved

I am using HttpURLConnection to make a POST request to a local service deployed locally and created using JAVA Spark. I want to send some data in request body when I make the POST call using the Ht...
Eudemonics asked 1/6, 2017 at 10:41

2

Solved

No, not Apache Spark. Sparkjava I have found to be the simplest approach to APIs and the one that clicks the most with me, but everyone states that it shouldn't be used for production, but no...
Enscroll asked 10/11, 2017 at 19:48

1

I'm playing around with Spark (the Java web framework, not Apache Spark). I find it really nice and easy to define routes and filters, however I'm looking to apply a native servlet filter to my r...
Funicular asked 17/9, 2015 at 13:17

4

Solved

I am working with the Spark web framework and creating a RESTful API. (http://sparkjava.com since there are multiple things out there named "Spark") My employer's standards mandate that we write a...
Toffic asked 26/6, 2015 at 15:21

3

Solved

I have this: get ("/test", (req, resp) -> { return repository.getAll(); }, new JsonTransformer()); My transformer looks like: public class JsonTransformer implements ResponseTransformer { ...
Mantis asked 12/11, 2014 at 19:35

4

I am using spark to develop a web application; the problem occurs when I want to upload a file: public final class SparkTesting { public static void main(final String... args) { Spark.staticFil...
Pullen asked 31/3, 2015 at 16:18

4

Where do I put files when trying to serve static files with the Spark web framework? I haven't been able to find anything online - I'm beginning to suspect I don't understand anything about class ...
Messmate asked 24/1, 2015 at 13:21

4

Solved

I'm trying to build a web api for my apache spark jobs using sparkjava.com framework. My code is: @Override public void init() { get("/hello", (req, res) -> { String sourcePath = "hdfs://spa...
Indemonstrable asked 28/1, 2015 at 7:14

3

Solved

I'm using SparkJava 2.2 which is using Jetty 9.0.2. I'm getting "Form too large" exception which is thrown by Jetty. I already know how to solve this problem if I was using Jetty directly: Form t...
Eastwardly asked 3/8, 2015 at 10:21

2

Java Spark framework uses embedded Jetty as as web server. Jetty supports connection pooling with tools such as HikariCP and provides configuration options in XML files. However, according to thes...
Koball asked 23/3, 2017 at 10:45

1

I am trying to figure out how to test a web/rest services written in Java Spark and there is not many tutorials on how to do that. It is tricky to find answers due to confusion between Apache Spark...
Irreplaceable asked 9/6, 2016 at 2:26

2

Solved

I have noticed something in the Spark Framework. It does not match trailing slashes with a mapped route. So it considers /api/test and /api/test/ as different URIs. That's fine if there is a way t...
Orchardman asked 12/1, 2016 at 20:17

2

Solved

I'm doing a project using Spark Java. On the server side, some images are created and I want them to be available in the client. Since I have a static content directory, after creating the image on...
Moyers asked 24/8, 2015 at 11:54

1

Solved

I have specified a location for static files in a Spark application: Spark.staticFileLocation("/public") Now I want to add a filter for some files (e.g. for security purposes), but it does not w...
Pantaloons asked 1/7, 2016 at 22:47

2

Solved

A hello world with spark: get(new Route("/hello") { @Override public Object handle(Request request, Response response) { response.type("text/html"); return "<h1>Hello Spark MVC Framewor...
Rossetti asked 10/12, 2015 at 9:2

1

I'm using Spark to serve a web page.. For the static files I initialize Spark like stated here: So I have this structure: /src/main/resources/public/ |-- foo/ |-- css/ | |-- bootstrap.css |--...
Misname asked 29/1, 2015 at 20:58

© 2022 - 2024 — McMap. All rights reserved.