• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with the request dispatcher

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
org.apache.jasper.JasperException: An exception occurred processing JSP page /StatusTRAN.jsp at line 13

10: request.setAttribute("trackid",request.getParameter("merchantreferenceno"));
11: request.setAttribute("amt",request.getParameter("amount"));
12: RequestDispatcher rd=request.getRequestDispatcher("../saveResponse.fly");
13: rd.forward(request,response);
14: %>
15: </BODY>
16: </HTML>


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

java.lang.NullPointerException
org.apache.jsp.StatusTRAN_jsp._jspService(StatusTRAN_jsp.java:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


I'm getting NullPointer Exception while forwarding requesting dispatcher please give me suggestion why it is happeninig?

please help me...
 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Double check the path to saveResponse.fly. It has to be relative to StatusTRAN.jsp.

You could try putting them in the same directory and then doing RequestDispatcher rd=request.getRequestDispatcher("saveResponse.fly")
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the values for these Parameters? . I doubt either of any one may return null.


Note: Putting Java Code in a Jsp is Poor Practice. Use Java classes for Java Code and access the classes from your backend/servlet and forward the return values to JSP for display
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch rajesh thallamapuram
 
rajesh thallamapuram
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm getting both the values.. and I kept statusTran.jsp inside webcontent --> payment gateway folder..

yeah putting the java code inside jsp is not good.. but, for the payment gateway i have to use JSP only....
 
rajesh thallamapuram
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes i kept the both jsp's in same folder. I'm accessing second using web.xml file because while executing the code in public server i'm getting some problems. So, through the web.xml I'm accessing.
 
rajesh thallamapuram
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any way I have decided to change my logic. Instead of forward i'm redirecting to jsp page and I used session to store attributes.

Thanks for your help

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic