Is it possible to create an object in one jsp page and then use it in
another jsp page.
Basically
JSP 1
MyClass myObject = MyClass();
myObject.setsomevariable="XXXXXXXX";
JSP2
myObject.getsomevariable;
I want to use this object to keep information about a user that has log
in e.g. Username, rights etc
I am pretty new to jsp so I don't even know if this is the right thing
to do
Andrew Thompson - 16 Nov 2005 09:44 GMT
> Is it possible to create an object in one jsp page and then use it in
> another jsp page.
?
<http://groups.google.com/group/comp.lang.java.help/browse_frm/thread/972497e3e4d
a7277/af27f485e93a10b6#af27f485e93a10b6>
Malte - 16 Nov 2005 19:19 GMT
> Is it possible to create an object in one jsp page and then use it in
> another jsp page.
[quoted text clipped - 13 lines]
> I am pretty new to jsp so I don't even know if this is the right thing
> to do
If you do not want to use a database, you could use session objects.
steinvommars - 18 Nov 2005 10:17 GMT
Or you can use
request.setAttribute("someString", objectName);
This will work If its from one page to another only.