File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes output of result.jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "output of result.jsp" Watch "output of result.jsp" New topic

output of result.jsp

Praful Chandekar

Joined: Jun 01, 2011
Posts: 8
Hi every one,
I am unable to get the output of "result.jsp"

<%@ page import="java.util.*" %>

<h1 align = "center"> Beer Recommendations JSP</h1>

List styles = (List)request.getAttribute("styles");
Iterator it = styles.iterator();
while(it.hasNext()) {
out.print("<br>try: " +;


I am getting java.lang.NullPointerException error in "http://localhost:8080/Beer-v1/result.jsp"
My & is compiled successfully without error or warning
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63053

It's likely that styles is null. What have you done to figure out why?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Praful Chandekar

Joined: Jun 01, 2011
Posts: 8
I am not getting what you said because in

List result = be.getBrands(c);

then how it could be null
Don't get me started about those stupid light bulbs.
subject: output of result.jsp
jQuery in Action, 3rd edition