Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: useBean

  1. #1
    Junior Member
    Join Date
    Sep 2009
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Lightbulb useBean

    Hi!

    i want to pass the bean value from one page to another jsp page,so for that i
    have done a code like this,But i am getting null value,help me out how to do that,.....

    first jsp:

    <jsp:useBean id="myBean" class="testBean.BeanClass" scope="session">
    <jsp:setProperty name="myBean" property="userData" value="123" />
    </jsp:useBean>
    <jsp:forward page ="index.jsp" />

    then i forward to ths page.....

    2nd jsp :

    <jsp:useBean id="myBean" class="testBean.BeanClass" scope="session"/>
    <jsp:getProperty name="myBean" property="userData"/>

    when i am getting ths value comes null.....
    did i made any wrong.....how do i do ths,......explain me....


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: useBean

    Are you just linking between your pages using a normal anchor tag?

    What happens if you remove this line from jsp2.

    <jsp:useBean id="myBean" class="testBean.BeanClass" scope="session"/>


    // Json

  3. #3
    Junior Member
    Join Date
    Sep 2009
    Posts
    19
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thumbs up Re: useBean

    Hi!

    Thanks,Yes after remove those tags,...Its WORKING...........Thanks once again

  4. #4
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: useBean

    No worries, please mark the thread as [SOLVED].

    // Json