aspose file tools*
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 Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "output of result.jsp" Watch "output of result.jsp" New topic
Author

output of result.jsp

Praful Chandekar
Greenhorn

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

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

<html>
<body>
<h1 align = "center"> Beer Recommendations JSP</h1>
<p>

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

</body>
</html>

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

Joined: Jan 10, 2002
Posts: 61761
    
  67

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
Greenhorn

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

List result = be.getBrands(c);
request.setAttribute("styles",result);

then how it could be null
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: output of result.jsp