PDA

View Full Version : Can I mention a jsp file instead of php to get JSON formatted data for grid



ghoshdew
4 Mar 2010, 2:05 AM
Is it possible to have jsp file instead of php to get JSON formatted data to populate a grid.



var store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'http://localhost:11533/JSONSample/index.jsp'
})

instead of


var store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'http://localhost:11533/extjs-2.2-src/examples/grid/data.php'
})


Its not working though when I am running the web application http://localhost:11533/JSONSample/index.jsp ,I can view the JSON formatted data.

Please find attached the screen shot of web app and grid output.

Thanks....

Animal
4 Mar 2010, 2:33 AM
You will use a servlet.

ghoshdew
4 Mar 2010, 2:43 AM
Its not working,I am not getting where am I failing.In server reponse I am getting the database rows and mentioned the JSON formatted content to the jsp file

Animal
4 Mar 2010, 3:27 AM
JSPs output HTML.

Use a servlet.

ghoshdew
4 Mar 2010, 4:13 AM
using servlet its working....
Thanks a lot for your guidence....

Krishna_tgkk
5 Mar 2010, 8:08 AM
Hi

Could you please share your experience. I am trying to build a Grid with data coming from JSP.

Could you please let me know how to start with.

As of now my project has a Java class which connects to the database and brings data. My JSP calls this Java class and displays the result in an HTML table. I want the same Data to display in an EXT Grid.

please help me out.

Thank you
Krishna

ghoshdew
7 Mar 2010, 10:18 AM
Sorry for the delay Krishna
Please find the attachment.
Its having a readme.txt please follow it.
Please feel free to ask if you have any queries.

Krishna_tgkk
8 Mar 2010, 8:10 AM
Hi

Thank you for the Reply. I am unable to find any attachment. If possible do send me a mail to [email protected]

Thank you

Regards
Krishna

ghoshdew
8 Mar 2010, 9:32 PM
I will try my best to send you the attachment asap.
sorry for the delay.

mahlatst
5 May 2010, 4:38 AM
Hi

Please send me the attachment too. I have the same problem.
My email: [email protected]

evant
5 May 2010, 5:15 AM
It's really not complicated. All you have to do is make your JSP echo something to the browser.

So if you navigate to www.mydomain.com/mypage.jsp, it will show:



{my: 'json'}