This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

gettin NullPointerException  RSS feed

subrahmanyam kunchala
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"/>

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
Posts: 4181
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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!