Link to home
Start Free TrialLog in
Avatar of Java_Problem
Java_Problem

asked on

Error code from Servlet

Hello J2EE Gurus

I am posting to an external servlet. This servlet is outside my domain and all it does is transfer

my application to a jsp page in my domain after doing some work at his end.

99% is servlet throws a Error code of 500 and then I never get to my page.

How should I handle this situation using error codes ??. I don't have any access to this servlet. All

All I do is post to this servlet and it redirects to my JSP page

Thanks

Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Check that it's available before transferring control to it. Ulimately you'll have to get them to fix it if the problem's at their end
Avatar of Java_Problem
Java_Problem

ASKER

How can I check even before I send the parameters that this servlet expects from my page. ? I know that it does some back end calls after getting required parameters and then only forwards to my JSP page.

So I need to have the response that it throws 500 ERROR and handle that.
What i was getting at is POSTing programmatically to the servlet and reading the response before progressing further
I found the answer of this question. Please delete this question
What is the answer? Was there something wrong in the servlet URL or was there an internal compilation error or something?
     if(response.SC_INTERNAL_SERVER_ERROR == 500){
      RequestDispatcher rd = request.getRequestDispatcher("target.jsp");
      rd.forward(request, response);

**************

PLEASE DELETE THIS QUESTION

**************
ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial