Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
    Bookmark Topic Watch Topic
  • New Topic

HttpSerponse Implementation

 
Nestor Fabio Alduey Gonzalez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Report post to moderator
I want to know which class can implement this interface, or if you can say me one way to validate the url of the servlet because if an user try to enter to the servlet by the url and the servlet still doesn't create it's object the program the application throw an error.

Pleasse...
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
Do you mean HttpServletResponse ? Why would you need this interface to verify the url that the client has entered ? Perhaps what you are looking for is a getQueryString() method or a filter ? Or may be you could configure an error page in the DD for a 404 error that says " Yo ! The page you requested does not exist." If you can tell us the requirement, we can give you a more specific answer.
 
Nestor Fabio Alduey Gonzalez
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Report post to moderator
The problem is that when the user wants to access to servlet by the url of the address bar of the explorer, it cause an error, and in the validation within the servlet I put

HttpSession session = req.getSession(true);
if (session.isNew()) res.sendRedirect("myjsp.jsp");
But the problem is that req is null and response is null too, for this I can't say response.sendRedirect("myjsp.jsp"); if I want to say that I have to create an object of both.

Nestor Alduey
SCJP 1.4
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thread continues here...
 
    Bookmark Topic Watch Topic
  • New Topic