English 中文(简体)
JSP Backend for ExtJS
原标题:JSP backend for ExtJS

This question is about a proper architecture using JSP as a controller for ExtJS.

我对服务器方面的发展来说是相当新的,但我很熟悉ExtJS 4,并更好地阅读Java和Kum。

我正试图设立一个共同项目控制员,以write/em>。 The data from Store in ExtJS. 我有MSSQL数据库和Tomcat在服务器上运行。

I successfully created a JSP (sqlData.jsp) that reads from the database and returns JSON data. I pass a query name to this JSP, it then looks up what the query is from a "query" table (columns: [query_id],[query_name],[query]). It then runs the query and returns the data in a JSON format - this is working fine to get data into ExtJS from a database.

为了利用这一备份结构,我通常会把库存混为一谈:

var store = Ext.create( Ext.data.Store , {
    model:  aModel ,
    proxy: {
        type:  ajax ,
        url:  sqlData.jsp?queryName=aQueryName ,
        reader:  json 
    },
    autoLoad: true
});

更有甚者,我需要这一数字,以便也能够处理一个<条码>的书店。 也就是说,共同财产调查组需要收到一份特别名册申请,然后根据一名个人资料进行更新(ExtJS发送了作为GET的读申请,并填写了store.save(<><>>>/code>等方法。

我的计划是,在 Java增加一些内容,以承认这是否是《太平洋行动计划》或《北美自由贸易协定》的要求。 之后,如果是一份POST申请,我将把它送到联合调查组内不同的 Java方法,将JSON捆绑起来,并写到数据库。

当然,我必须改变我的“频率”表,以备有与同一查询/格式(即:[query_id]、[query_name]、[elect_query]、[update_query]有关的更新/插入说明栏。

Does this backend implementation make any sense?

任何其他人都利用JP和ExtJS实现这一顺利?

I noticed that there is an api config option I can set in my proxy to specify different URLs for the different operations (READ, WRITE, DELETE, etc). Should I make a separate JSP and direct all write requests using this config instead?

添加<条码>作者:json config on the Alain so that it parses before 位置? 我表示,我不得不在联合人民党中加以仿效,这样我才认为我应该这样做。

任何要点都将受到高度赞赏。

最佳回答

既然你们的支持者是 Java,我真的会建议使用普春3.0米宽克,代之以代号。

共同未来党不是你做的好选择,因为:

  1. the functions you write in there are not unit testable.
  2. the functions you write in there are not reusable.
  3. the code you write in JSP are functional in nature, not object oriented, you can t inject the services you need into your JSP.

春季3.0 MVC与ExtJS 4,即RESTful URL和内容谈判,有着真正的良好协同作用。

这一实例表明,如何将这两个事项合并起来:

问题回答

我会ski笑,只是直接去服。 i.e. 既为返回的json,又处理诸如POST、PUT等物品,采用服务器中的逻辑。

jsps是意见。 但就你而言,你认为自己在客户中应用。 你们只需要数据。

《服务手册》文本允许你处理请求,获取http://www.un.org/www.un.org/french/ga/president

我的建议涉及一个MVC服务器辅助框架。 我的喜爱是让你直接为投入和产出而与JSON物体合作。 该数据库还简单易用铁路读写数据。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...