aspose file tools*
The moose likes JSP and the fly likes JSP Only-Session cookies error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Only-Session cookies error" Watch "JSP Only-Session cookies error" New topic
Author

JSP Only-Session cookies error

Gez Sosa
Greenhorn

Joined: Jun 19, 2012
Posts: 1
Hi everyone!

i have a problem with a project.

i am getting org.apache.jasper.JasperException. i dont know whats the reason.

i am getting error at this step

step 55:
Cookie[] cookiesdevueltas = request.getCookies();
Cookie cookie_individual;
52: String Apellido_Registrado;
53: String Nombre_Registrado;
54: int i;
55: for(i=0; i< cookiesdevueltas.length;i++)
56: {
57: cookie_individual = cookiesdevueltas[i];
58: if(cookie_individual.getName().equalsIgnoreCase("nombre"))


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)

causa raĆ­z

java.lang.NullPointerException
org.apache.jsp.Inicio_jsp._jspService(Inicio_jsp.java:118)
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)


Please help me to solve this prob. Thanks in advance
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
Insert standard disclaimer here about how you shouldn't use Java in a JSP file...

But the information is all in the error message. You have to ask yourself what could be null on line 55 of your JSP?


It's not 'i'
so it must be cookiesdevueltas

A quick check of the API proves that the get cookies method returns:
an array of all the Cookies included with this request, or null if the request has no cookies
There are no cookies with the request, hence your null pointer exception.

A quick check of


should solve your null pointer problem.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Only-Session cookies error