Todd Smith

Greenhorn
+ Follow
since Dec 16, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Todd Smith

I am getting a Caused by: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: gov.michigan.mdch.ibs.domain.Users.userRoleses, no session or session was closed.


I am using JQUERY for my Ajax to call the controller. The Controler will pass back a JSON object to be render in a div tag on the JSP
I know the user bean I am trying to return has 2 children tables. I have included the user bean and the DAO. I have tried the OpenSessionInViewFilter in the web.xml and that is not working. I just wanted to know if you had any ideas.
Thanks
Todd


Is site sitemesh any good in a Spring 3.0 MVC project? What are the Pros and Cons of using it. Currently I am working with MyEclipse for Spring. It has a Scaffold feature to look at your database tables which creates all the CRUD methods DAO, Domain Beans, Controllers and Services and it also creates a UI interface in JSP using the SiteMesh to access all the CRUD for the database tables. I am trying to decided if I should learn sitemesh to change the screens to make them more what my users are asking for or just skip using sitemesh and code my own JSP's calling the generated controllers, services and DAO.

Thanks
I want to clean up my code. I am getting a JSON Object returned from my spring controller and I am display it using the Jquery .append method. It looks very messy. Should I be using jQuery Template Markup Language (JTML) to clean it up. Please advise



[Edit: modified subject as this has nothing to do with JSP]

Bear Bibeault wrote:

Todd Smith wrote:My Spring control is returning a Java listarray of objects.


No it's not. It can't. An HTTP response can only be text. Is it perhaps returning JSON or some other format? You are going to need to get your data transfer straight before any kind of progrss can be made.



You are right I have the @ResponseBody in my Spring Controller and I am passing back JSON. I can see all the objects in FireBug console but I still can't get them displayed on the page.





13 years ago
JSP
I still don't understand I guess. My Spring control is returning a Java listarray of objects. I am trying to display that list array I don't see any of my data and i am not seeing any error in firebug here is my code

Here is my First page



Here is the page from my JQuery .Load

13 years ago
JSP
ok thanks I finally got it working. i am now loading the jsp. I am getting closer. Now I need help getting the data that is passed back from the spring controller loaded on my JQuery .load jsp.





13 years ago
JSP
I also have tried this




Generates this

13 years ago
JSP
I have tried this and still get a 404 page not found



codes generates this which is not correct

13 years ago
JSP

Bear Bibeault wrote:That obviously means that the URL is malformed. What's your next step?

(Hint: page-relative URLs are death in a web application.)



I am still stuck. I took a look at your book over the weekend Manning jQuery in Action 2nd Edition. It is a very nice book alot of cool examples. I could not relate any of the examples to what I am trying to do.
13 years ago
JSP

Bear Bibeault wrote:You're not using a JavaScript debugger?

Download the Firebug plugin for Firefox. All of the other modern browsers have built-in debuggers.

Use the debugger to look at the Ajax request/response.




Ok I am using firebug I am getting a 404 not Found it can't find my jsp I reference in the .load. I am not to sure what to do. the JSP is in the same folder as my main JSP

13 years ago
JSP

Bear Bibeault wrote:The mostly likely cause of that is the response is not being returned correctly. What you have you done to look at the status and body of the response?



I guess I am not doing any thing to check the response. what should I be doing to check that? Here is my Controller that is being called and it's return

13 years ago
JSP

Bear Bibeault wrote:"doesn't work" doesn't tell me anything useful. What is happening?




I don't see the other page being inserted in to the tag id="page". I do see my results of the .replace. Here is a screen shot

13 years ago
JSP

Bear Bibeault wrote:

jq.load('ajax-add-page1.jsp',data);


This is not the correct way to use the .load() method. It's a jQuery method, not a utility function. It must be called on a selector that identifies the element into which the response will be injected.




Is this the right way? My .replace works but the load still does not work.

13 years ago
JSP
This still does not work. I am not display the jsp

13 years ago
JSP



The format of the data is JSON
13 years ago
JSP