wood burning stoves 2.0*
The moose likes Web Services and the fly likes Can I access pagecontext or session variables in an ajax service class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Can I access pagecontext or session variables in an ajax service class?" Watch "Can I access pagecontext or session variables in an ajax service class?" New topic
Author

Can I access pagecontext or session variables in an ajax service class?

firoza limbada
Greenhorn

Joined: Feb 19, 2010
Posts: 11
I am trying to update a table that was initially populated on the jsp using table tags. We are using Ajax to do the data refresh but I am having trouble accessing the full table content in the ajax service class. I can't pass the table object using javascript unless I break the data down into a Javascript object. I have investigated using the DWRUtil.AddRow function but would need to recode what the table tag currently does which is not feasible. Can someone please assist by letting me know if I can access the pagecontext or session variables in the Ajax service class - I would then be able to pass the table object from the jsp in this way, and then resuse the table tags to rebuild the table
firoza limbada
Greenhorn

Joined: Feb 19, 2010
Posts: 11
I have managed to access the session variables as follows


However, I now get a null ponter exception when trying to execute the doEndTag() method as the JSPWriter out is null. If I set this manually during debug to PrintWriter it executes with no errors but the updated table is not displayed to the screen. Can you please tell me how to set the PrintWriter programmatically and what else I need to do to display the updated table data


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can I access pagecontext or session variables in an ajax service class?
 
Similar Threads
Doubts
updated table not displaying on page
Populate Table Rows With Data from AJAX
Passing/Accssing HttpSession to service layer
What are the benefits of AJAX ?