• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Request Object

 
Shivangi Joshi
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to get request object in Servlet If I am not using any HTML or JSP page.So in this case How doGet() will understand what is request coming from browser.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64178
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An HTTP request really has nothing to do with an HTML page or a JSP. It can be generated by any number of tools. As long as it conforms to the HTTP rules, a servlet can deal with it just fine.

Perhaps you can add some context to your question?
 
adil qureshi
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This way you can handle whether request is a get or post ...

public void doGet(HttpServletRequest request, HttpServletResponse response) {doPost(request,response);}
public void doPost(HttpServletRequest req, HttpServletResponse res) {}

Secondly as you can see that doGet() / doPost() already has the request parameters so you can always get whatever you want from incoming request to the servlet....also can you please discuss in detail what you want to know
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic