Note that there are some explanatory texts on larger screens.

plurals
  1. POInvoking the resource of REST Web service
    text
    copied!<p>I am writing a REST Web service. This is a snippet of Web service:</p> <pre><code>@Path("/first") public class InitialResource { @GET @Path(value="/{input}/{location}/{category}/{session}") @Produces({"application/xml", "text/html"}) public List&lt;Message&gt; getMessage(@PathParam("input") String input, @PathParam("location") String location, @PathParam("category") String category, @PathParam("session") String session) throws NotFoundException { if(date.recentUpdate(location) == false)// if false, the checking of category update was run later than 1 hour ago { user.dropTable(); // invokes method which checks if you need to drop any user's intermediate results table if(version.getVersion(location)== true) // if version of category did not change { } else {// version of category old; updates list of category for a specific country updateCategory.getCategoryList(id.getSiteId(location)); } } return search.runSearch(input, location, category, session.split("\\.")[1]); } } </code></pre> <p>If you invoke it through this URI</p> <pre><code>http://localhost:8080/Project/resources/first/cat/EBAY-IE/1/0.123 </code></pre> <p>you get 404 HTTP error.</p> <p>There is one more resource below.</p> <pre><code> @GET @Produces("text/html") public String getMess( ) { return "hello"; } </code></pre> <p>If you invoke the service with this URI</p> <pre><code>http://localhost:8080/Project/resources/first </code></pre> <p>you get "hello" string on the screen. Why I can't invoke the first resource with specified path?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload