• Post Reply Bookmark Topic Watch Topic
  • New Topic

Restful service  RSS feed

 
njkhjk huihujjk
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello I have a Rertful service CRUD for User and I am now facing a problem with the interface JSP Pages How can i invoke the service I am thinking about a servelet that contain the service
is that a soluthion ?
and what is a Proxy client
thank you
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should not be thinking JSP for this problem.

A RESTful service should be able to process requests and respond with a variety of content types, a JSP generated page might be OK for a single GET HTML content request but it will take a servlet to handle more logic.

Bill
 
njkhjk huihujjk
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok so i should change to html ?
after I develloped the EJB i created a dynamic web project that contain the rest service and the HTML file finally i will create an EAR but i should program some controller but the problem i did not inderstant
is the controller is a servlet or a restful service ?
 
Kumaravadivel Subramani
Ranch Hand
Posts: 171
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As mentioned by William, the business or connectivity(in terms of calling any service) logic should be in Servlet only. Jsp pages will just request some resource and ideally your Servlet should recognize the request and pass to the appropriate service/component. If you use Spring 3 Rest service, you can map the URL pattern to invoke the service and no need of Servlet in place as controller. But it depends on your design how you have implemented.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!