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 7514539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:31:39+00:00 2026-05-30T00:31:39+00:00

This is my jsp page (which is a modal page to another jsp page

  • 0

This is my jsp page (which is a modal page to another jsp page ) which contains a table, a form, a javascript and ajax .

<%@ include file="/WEB-INF/includes/taglibs.jsp" %>
<script type="text/javascript"
        src="${pageContext.request.contextPath}/ajax/prototype.js"></script>
<script type="text/javascript" xml:space="preserve">

function invoke(form, event, container) {        
        var params = Form.serialize(form, {submit:event});
        new Ajax.Updater(container, form.action, {method:'post', parameters:params});
    }
</script>

<display:table name="actionBean.currentAidApplicantYear.comments" id="result" class="maui">
    <display:column property="lastUpdatedBy" title="Last Updated By" sortable="true"/>
    <display:column property="lastUpdatedTimestamp" title="Last Updated Date"
                    format="{0,date,MM/dd/yyyy HH:mm}" sortable="true"/>
    <display:column property="comment" title="Memo"/>
</display:table>
<div class="actionBar" style="margin-top: 20px; text-align: center;">
    <stripes:form beanclass="${actionBean.class}" id="addMemoForm" method="POST">
                <tags:labelAndValue label="Comment" name="comment" >
                    <stripes:textarea id="commentTextArea" name="comment.comment" cols="75"/>
                </tags:labelAndValue>
        <stripes:submit name="saveCommentAjax" value="Add Memo"
                        onclick="invoke(this.form, this.name, 'result');"/>
        <stripes:hidden name="id" />        
    </stripes:form>  
</div>

And this is part of the action bean which extends another class which in turn implements ActionBean, ValidationErrorHandler

Public class  CommentsTab extends AbstractAidApplicantTab {
private AidApplicantYearComment comment;

    public AidApplicantYearComment getComment() {
        return comment;
    }
    public void setComment(AidApplicantYearComment comment) {
        this.comment = comment;
    }
public Resolution saveCommentAjax(){
                    String result = String.valueOf(comment.getComment());
                    comment.save();//build up the comment object 
//by this time the comment object will save the string comment, user who updates it and a //time stamp. Those are the three variables that are displayed on the jsp table.
        return new StreamingResolution("text/html",new StringReader(result));}
//here instead of returning just a string “result” I prefer to return a comment object or //the three values I wanted to display on a table. How can I do that?

When the submit button is clicked I use an ajax to call an action bean’s method to do some operation and the function returns a streaming resolution (StreamingResolution(“text/html”,new StringReader(result));). Once I get the response I wanted to refresh the table without refreshing the page. However, in order to do that I have to get an object (a comment object) from the response not a text (or may be an array of Strings which might contain the values of the object)

Any help would be appreciated. Thank you

  • 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-30T00:31:41+00:00Added an answer on May 30, 2026 at 12:31 am

    Use a JavaScriptResolution, or (better IMHO),

    • transform your Comment object into a JSON String (using one of the myriads of free Java JSON encoders available),
    • return that JSON String as a StreamingResolution
    • use the native JSON functions in the browser (if you target recent browsers) or a JS library containing a JSON parsing function to transform the JSON string into a JavaScript object.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jsp page, which imports another jsp. This import is wrapped into
I have a login.jsp page which contains a login form. Once logged in the
This is my sample html page which contains inline javascript which calculates the geocode
I've a jsp page which is like this: <form:form action=userRegistration name=userRegistrationForm commandName=userRegistration> <form:input path=userName/>
I have a jsp page which needs a java code. This java code inside
I have an HTML table in my jsp page. This conains text fields and
I want to include jQuery UI in my jsp page. I tried this <jsp:root
I've a jsp page which saves a request parameter inside a javascript variable. Say
I have this DIV on my application jsp page which I need to inject
I have a JSP page which loads another jsp page's content which is working

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.