Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7055167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:42:57+00:00 2026-05-28T03:42:57+00:00

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

  • 0

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

I am fairly new to server side development but I am pretty familiar with ExtJS 4 and getting better with Java and SQL daily.

I am trying to create a JSP controller to write the data from stores in ExtJS. I have MSSQL database and Tomcat running on the server.

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.

To use this backend set-up I usually configure the store like this:

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

Somehow, I need this sqlData.jsp to also handle a store.save() call from the ExtJS framework. Which means the JSP needs to receive a POST request and then do an update based on a pile of JSON data (ExtJS sends read request as GET and write methods like store.save() are POST).

My plan was to add something in the Java to recognize whether it is a POST or GET request. Then, if it is a POST request, I would send it to a different Java method in the JSP to parse the JSON and write it to the database.

Of course I would have to change my “query” table to have another column for update/insert statements linked to the same queryName (i.e.: [query_id],[query_name],[select_query],[update_query]).

Does this backend implementation make any sense?

Anyone else use JSP and ExtJS to achieve this smoother?

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?

Would it be wiser to add a writer: 'json' config on the proxy so that it parses before POSTING? I figured I would have to parse it in the JSP either way so I didn’t think I should.

Any pointers will be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:42:58+00:00Added an answer on May 28, 2026 at 3:42 am

    since your backend is Java, I would really recommend using Spring 3.0 MVC to code your backend.

    JSP is not a good option for the stuff you are doing because:

    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.

    Spring 3.0 MVC has really good synergy with ExtJS 4, namely the RESTful URL’s and content negotiation.

    This example shows how to integrate the two things together. http://java.dzone.com/articles/extjs-4-file-upload-spring-mvc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Followed this question about delayed_job and monit Its working on my development machine. But
I have seen this question about deploying to WebSphere using the WAS ant tasks.
I have a question about this question . I posted a reply there but
I posted a question about this earlier, but I have more information now and
Not sure if this is the proper place to post this question, but I've
First off I'm not sure that's the proper title for this question but hopefully
This question about Timers for windows services got me thinking: Say I have (and
This question is a follow up to my previous question about getting the HTML
I was reading this question about how to parse URLs out of web pages
I just came across this question about initializing local variables. Many of the answers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.