473,400 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,400 software developers and data experts.

RequestDispatcher method is not working.

Dear Sir,
I am calling procedure in my servlet program.The procedure returns correct valule.

For example

If the Logid id wrong then errorType Returns E and errorDesc LOGIN ID IS NOT AVAILABLE.
i am set this error message request.setAttribute("errorLogin", "Invalid Login ID") and forward to /help/NewPassword.jsp


If the Date of Birth wrong then errorType Returns E and errorDesc DOB IS NOT AVAILABLE.
i am set this error message request.setAttribute("errorDob", "Invalid Date of Birth") and forward to /help/NewPassword.jsp


I am getting proper return type from procedure.This server log.
[16/Jan/2009:19:20:56] info ( 3972): CORE3282: stdout: errorType...->E
[16/Jan/2009:19:20:56] info ( 3972): CORE3282: stdout: errorDesc...->ERROR::DOB IS NOT AVAILABLE
But while forwarding same errormsg to jsp using the syntax it is not forwarded to jsp.No exception comming.But help/NewPassword.jsp this also exist.The blank is comming.
request.setAttribute("errorDob", "Invalid Date of Birth");
strJspCalled =response.encodeRedirectURL("/help/NewPassword.jsp");
The code is given below.Could you please rectify my code/guide me for the needful.

Expand|Select|Wrap|Line Numbers
  1.  
  2.        try
  3.          {
  4.                    HashMap values = new HashMap();
  5.                    String procString="PR_ITS_CUSTOMER_AUTH (?,?,?,?)";
  6.                    values.put("1",userid);
  7.                    values.put("2",dateofbirth);
  8.                    values.put("3","Types.VARCHAR");
  9.                    values.put("4","Types.VARCHAR");
  10.                     HashMap out = new HashMap();
  11.                      strRespLogin ="You have entered wrong existing login password.";
  12.                      dbCon = new OracleDbConnector(ConnectionPool.interactiveConnectionPool);
  13.                     if(dbCon!=null)
  14.                    {
  15.                      out = dbCon.CallStatementForProc(procString,values);
  16.  
  17.                      if(out!=null)
  18.                      {
  19.                          errorType = out.get("3").toString();
  20.                          errorDesc = out.get("4").toString();
  21.  
  22.  
  23.                         }
  24.  
  25.  
  26.                    }
  27.  
  28.                    if(errorType.equals("E"))
  29.                    {
  30.                     if (errorDesc.equals("LOGIN ID IS NOT AVAILABLE")){
  31.                         request.setAttribute("errorLogin", "Invalid Login ID");
  32.                         strJspCalled =response.encodeRedirectURL("/help/NewPassword.jsp");
  33.                         RequestDispatcher dispatcher=request.getRequestDispatcher(strJspCalled);
  34.                         dispatcher.forward(request,response);
  35.                         return;
  36.                     }
  37.                     else if (errorDesc.equals("DOB IS NOT AVAILABLE")){
  38.                          request.setAttribute("errorDob", "Invalid Date of Birth");
  39.                          strJspCalled =response.encodeRedirectURL("/help/NewPassword.jsp");
  40.                          RequestDispatcher dispatcher=request.getRequestDispatcher(strJspCalled);
  41.                          dispatcher.forward(request,response);
  42.                          return;
  43.                      }
  44.  
  45.                    }  
  46.        }catch (Exception e) 
  47.          {
  48.         e.printStackTrace();
  49.  
  50.          }
  51.  
Thanks and Regards
Sumanta Panda
Jan 16 '09 #1
1 3070
Dear All,
i request you to all please advise me for the above needful.

Regards
Sumanta Panda
Jan 17 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: K S Aldebaraan | last post by:
I'm trying to submit a form with an action of a servlet, and a view equal to the same jsp page. I'm not sure what I'm doing wrong, but keep getting a NullPointerException on the second line of...
10
by: John Brock | last post by:
I have a base class with several derived classes (I'm writing in VB.NET). I want each derived class to have a unique class ID (a String), and I want the derived classes to inherit from the base...
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
5
by: RickDee | last post by:
Please help, anybody. I am trying to write a program so that it can launch an exe file ( which is also genereated in C# ) and then simulate the button clicking and invoke the methods inside the...
19
by: zzw8206262001 | last post by:
Hi,I find a way to make javescript more like c++ or pyhon There is the sample code: function Father(self) //every contructor may have "self" argument { self=self?self:this; ...
7
by: cbmeeks | last post by:
Hope I'm using the right terminology. Anyway, say I have a class like: class Animal { public double GetValues() {......} public void FilterBy(string text); {......}
11
by: =?Utf-8?B?QkxVRVNUQVI=?= | last post by:
Here is the link of the website http://www.smartcharlotte2050.com/YourThoughts.asp I have been told to change only the form action part of this site.which is to "response.asp" Here the method...
5
dmjpro
by: dmjpro | last post by:
Could anyone tell me what is difference between jsp:forward and RequestDispatcher.forward? These two codes behave differently ... <jsp:forward page="page_ref"/> and
3
by: sumanta123 | last post by:
Dear All, In the DoPost() i am calling the function sendTextMail(strFromUser, strToUsers, strCcUsers, strSubject, strMessageBody, strobjAttachments) in the Try catch block. Now the code compiles...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.