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

  • Home
  • SEARCH
  • 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 880017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:01:41+00:00 2026-05-15T12:01:41+00:00

Can anyone psuedo a solution to my problem, or just give discussion to help

  • 0

Can anyone psuedo a solution to my problem, or just give discussion to help me find a solution? I’ve always found that using JSP to populate HTML is a very awkward solution to creating pages, and if you want to convert to AJAX almost always results in needing to rewrite the whole “component” or whatever it is your displaying. I need a story viewer, and I’d like to have the actual work of populating the story viewer to be written in javascript, with one entry point, so that I can either bring in the information when the page loads, or refresh it using ajax, or use the component standalone on another page if I wish.

SERVER:

A server can configure the kinds of new stories available to a page, and the controller sends back a model populated with stories to display:

@RequestMapping(value="/news/{category}")
public String news(@PathVariable("category") String category, Model m) {

    m.addAttribute("featuredStory", newsService.getFeaturedStoryForCategory(category));
    m.addAttribute("otherRelatedStories", newsService.getStoriesByCategory(category, 3/*num of stories*/));
    return newsService.getViewNameForCategory(category);
}

VIEW:

<div>
<h1>Story Title Would Go Here</h1>
<div>maybe some text description here</div>
<img src="my image source would go here"/>
</div>

so that’s my basic setup, but now I need to get information from my servers model into components that look roughly like that, I’ve had several different thoughts, but I can’t seem to get any momentum going with them, one example is that I’m thinking at the of the page in the I could have something like this:

<javascript>
var populateFeaturedStoryWithJson( json ) {
   ...
   $(#featuredStoryId).insert(json.getStoryTitle);
   ...
}
</javascript>

but who would be responsible for making that call? how do I get the JSON from the server model? I don’t want to be bound to using ajax requests, I’d just like to have the option to have the content come from different sources, so that the only code that changes is that of fetching the story content, not displaying the content in my component

I know this question is a little broad, but I think that it would really pay off if I could avoid the common solution of something like:

<h1>${featureStory.title}</h1>

Since I’ve always found that to be the most awkward and un-object-oriented portion of the Spring-MVC way of doing things

edit: i’m open to other ideas than just javascript, but what I really want is a view component that can get it’s data from different places where literally the only things that changes is the code that takes data from that source and converts it to the views data model

  • 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-15T12:01:42+00:00Added an answer on May 15, 2026 at 12:01 pm

    Using JSP here is standard, you could use JSP to intialize Javascript variables on page load if that’s what you’re looking for

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

Sidebar

Related Questions

I found this programming problem while looking at a job posting on SO. I
I am using the jQUery color plugin . I have an li element that,
I need to create a simple text file based search engine asap (using PHP)!
For a small program that I am developing, I decided it's best to implement
This is a long shot, but I thought I might try before starting the
One of my junior programmers has created a singleton, but it is acting strangely:
Is there a Linq way of knowing what the next element in the sequence
I started to use silverlight/flex and immediately bumped into the asynchronous service calling. I'm
In ASP.NET MVC 2, TempData values persist until the session ends or until they
I'm trying to figure out if i have the general idea behind the assignment

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.