Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

gettin NullPointerException

 
subrahmanyam kunchala
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
i have one jsp like one.jsp,
iam calling(including) this one.jsp from another jsps(so many like >50)
in that(ie:-calling pages other than one.jsp) some pages used <jsp:useBean id="lbean" class="pack1.ClassName" scope="session"/>

then,
i have one requirement, that i need to get one value using that "lbean" id of <jsp:useBean/>
if i passed that value from calling jsps to one.jsp, i need to pass that value from all calling jsps to one.jsp.
it is very critical not reqired also..

iam trying to get that value from one.jsp itself with different id of <jsp:useBean id="lbean1" class="pack1.ClassName" scope="session"/>
iam getting java.lang.NullPointerException.
and suppose if iam using same id in that one.jsp, i.e:<jsp:useBean id="lbean" class="pack1.ClassName" scope="session"/>
iam getting error like already "lbean" is used like that iam getting....


any body please resolve this.. actually wat happend.....
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you doing the include? It sounds like you are doing a static include using <%@include %>. In that case, lbean would already exist as a variable, and all you would have to do is use

If you aren't using the @include directive please show:
1) The code you are using to include the jsp
2) The real, full error message you get when you provide the same name for the bean id.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic