aspose file tools
The moose likes JSP and the fly likes gettin NullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "gettin NullPointerException" Watch "gettin NullPointerException" New topic
Author

gettin NullPointerException

subrahmanyam kunchala
Greenhorn

Joined: Oct 29, 2008
Posts: 1
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

Joined: Jan 28, 2003
Posts: 3036
    
    4

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.


Steve
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: gettin NullPointerException
 
Similar Threads
jsp:getProperty calling bean from specific scope
previously discussed question
Variable value attribute in jsp:setProperty
accessing .class file from jsp
doubt on getProperty in various scopes