This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
hi, i create a bean instance in first jsp page (i.e <jsp:useBean id="obj" name="Bean" scope="session"> ).and set it attriubtes in same page using jsp:setproperty.i've to access the same bean instance in another jsp page.i could not do so although i've used session as scope.but it does not work.Remember the another jsp page should use same bean instance not create new one. thanks in advance khurram mirza
Hi, make sure you used the same ID on the other JSP and make sure that the session id is stored. (That means: Either you should use encodeURL on every link or make sure that cookies are enabled in your browser) ------------------ Marco Barenkamp ____________________________________________ L M I N T E R N E T S E R V I C E S AG Senior Trainer & Architect, BEA Certified Enterprise Developer Sun Certified Programmer for the Java2 Platform Sun Certified Web Component Developer for the Java2 Platform Sun Certified Developer for the Java 2 Platform Sun Certified Enterprise Architect for the Java 2 Platform Enterprise Edition (PI)
Marco Barenkamp<br />_ _ _ _ _ ________________________ _ _ _ _ _ <br />L M I N T E R N E T S E R V I C E S AG<br /> <br />Head of Software Development<br /> <br /> <br />BEA Certified Enterprise Developer<br />Sun Certified Programmer for the Java2 Platform<br />Sun Certified Web Component Developer for the Java2 Platform<br />Sun Certified Developer for the Java 2 Platform <br />Sun Certified Business Component Developer for the Java 2 Platform <br />Sun Certified Enterprise Architect for the Java 2 Platform Enterprise Edition<br /> <br />LMIS AG
i have observed the same problem with variables of custom tags in jsp .Even though their scope is entire application they are not accessible outside the current JSP . I think it is the problem with the JSP to maintain the the variable to its scope
Manas<br />Today If You are not Confused,You are just not thinking Clearly !<br />---------------------------------
I was facing the same problem. I think the location of setProperty matters.If it is used in same page as where bean is instantiated and form variables have value=bean's getProperty, the bean though available dosen't store that value. However if you try 1>Posting the form to a different JSP and useBean with same id 2>USE SETPROPERTY HERE you should be able to access the values from previous form as bean attributes(assumptions here are proper scope of bean is used and property names are appropriate) Try this, this should work Regards, Bhushan