File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with the request dispatcher

 
rajesh thallamapuram
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • 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...
 
J. Kevin Robbins
Bartender
Pie
Posts: 1607
15
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • 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")
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • 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 Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch rajesh thallamapuram
 
rajesh thallamapuram
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic