aspose file tools*
The moose likes Servlets and the fly likes session variable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "session variable" Watch "session variable" New topic
Author

session variable

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 751
hi

i want something like following (MVC architecture)

When user login i'm creating DOM instance. When user click on addNode Button
1 NODE get added to my XML document object
<DOC>
<NODE>
...
...
...
...
</NODE>
</DOC>

and than again user clicks on addNode button the another node should be added to my XML Document

after 2nd click
<DOC>
<NODE>
...
...
...
...
</NODE>
<NODE>
...
...
...
...
</NODE
</DOC>

currently when i 2nd time click on addNode button it creates a new XML Document object. and than add 1 NODE to that newly created XML Doc.

i guess this is something related to session... am i right ?

so when the same user is clicking on the addNode button.
it shuld first check if Document is there or not else it should create a new document object and than add a new node to it.

This should be executed once per user session and doc shuld be available to entire application.

how it is possible ?
[ July 15, 2007: Message edited by: Bear Bibeault ]

Jigar Naik


Hanuma Deepak Muvvala
Ranch Hand

Joined: Nov 20, 2005
Posts: 158
In the addNode logic first getSession by cllaing getSession(false);
I think you will have always session so this will return a session object then call isNew() method on this if it new create the Document else just add node to the document. Hope it may solve........

Regards,
Deepak.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: session variable
 
Similar Threads
Append Child node in DOM
Simple list table
Read data to the xml file from the database?
servlets and xml
Tutorial PostgreSQL 8.3 on Glassfish V2.1 for ConnectionPool in Netbeans 6.5.1, WindowsXP (Post 3)