Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Intro to Java Web Development with Spark Diving into Web Development Accepting Requests

Mojo Waters
Mojo Waters
5,748 Points

post not visible

Hi guys, My spark doesn't see post() neither req, res. I have it imported, but I am not that lucky like Craig with API. Can it be like a intellij version thing or something? And it always wants to import HTTPMethod.post - Spark. post I just manually added. Please help

import spark.ModelAndView; import spark.template.handlebars.HandlebarsTemplateEngine;

import static spark.Spark.get; import static spark.Spark.post; import static spark.route.HttpMethod.post;

public class Main {

public static void main(String[] args) {


    get("/",(req,res) -> {
            return new ModelAndView(null, "index.hbs");
    }, new HandlebarsTemplateEngine());
}

    post("/sign-in",(req,res) - > )

}

Mojo Waters
Mojo Waters
5,748 Points

I am sorry, I found a problem. Stupid Mustache that's all it was. sorry for bothering. Thanks!