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 OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP 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: 61985

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
I agree. Here's the link:
subject: output of result.jsp