permaculture playing cards
The moose likes Servlets and the fly likes How to Request Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to Request Object" Watch "How to Request Object" New topic

How to Request Object

Shivangi Joshi

Joined: Jun 01, 2007
Posts: 23
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

Joined: Jan 10, 2002
Posts: 63838

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?

[Asking smart questions] [About Bear] [Books by Bear]
adil qureshi
Ranch Hand

Joined: Jul 11, 2008
Posts: 48
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

SCJP 1.5,SCWCD 1.5
I agree. Here's the link:
subject: How to Request Object
It's not a secret anymore!