-3

I am developing a video search engine for my research in the campus. It is semantic based search engine. I use JavaEE for my backend and I suppose to use php for my front end development. But I want to keep these two as separate web applications and make communication between them. How can I do that, I want to pass data between php to javaEE using web services.

I wrote a code from javaEE to get user inputs and give the output for matching words as json.It is works fin with postman but i want to get those inputs from web page.

@POST
@Path("/setItem")
@Consumes(MediaType.TEXT_PLAIN)
//@Produces(MediaType.APPLICATION_JSON)
public Response getResultForTypedQuery(String item){

    initializeOntologyModel();

    System.out.println(item);

    JSONObject getResultJSON = new JSONObject();

    OntologyRelationship OR = new OntologyRelationship();
    getResultJSON = OR.OntologyAsJSON(item,model,URI);

    ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
    String JSONobjectConverted = null;

    try {
        JSONobjectConverted = ow.writeValueAsString(getResultJSON).toString();
    } catch (JsonProcessingException e) {
        e.printStackTrace();
    }

    return Response.status(200).entity(JSONobjectConverted).build();

}
2

1 Answer 1

1

First PHP is not for front end development. But if you meant to develop two applications one in PHP and second in Java and somehow communicate between the two you can check PHP/Java Bridge. I am not sure how updated it is, I used in couple of years ago but hope it will help you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.