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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:07:30+00:00 2026-06-09T12:07:30+00:00

I am a PHP developer but am transitioning to Java. (very new to Java

  • 0

I am a PHP developer but am transitioning to Java. (very new to Java at this point)

Is there a way to make an ajax call to a Servlet, and respond with the output of a separate .jsp file (as opposed to html or json created directly in the Servlet)?

Here is an example of what is common practice w/ Zend Framework, which is what I would like to do with Java if possible:

public function myAjaxCallAction(){
    $this->view->someVar = 'whatever';
    $this->view->hello = 'world';
    $output = $this->view->render('someViewScript.phtml'); // the above vars are in this view
    echo $output;
}

Again very new to java, any advice pertaining to this type of situation would 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-06-09T12:07:31+00:00Added an answer on June 9, 2026 at 12:07 pm

    Just try to load the .jsp that you want. Normally you will use a JSP fragment (.jspf). If you want to load its contents, you can do something like:

    Your page:

    ... content ...
    <div id="container"></div>
    ... content ...
    

    Javascript of the page above (using jQuery):

    $(function(){
        $( "#container" ).load( "pathToYoutJsp/file.jsp", { someVar: "whatever", hello: "world" } );
    });
    

    The JSP that will be loaded will look something like:

    ... content ...
    ${param.someVar} foo foo foo ${param.hello}
    ... content ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm PHP developer and I know very little when it comes to https/ssl, but
I am a java/php developer helping someone with actionscript. I don't understand why this
I'm quite new to vb.net as I'm much more of a PHP developer but
im very new at javascipt (im php developer) so im really confused trying to
I'm not a PHP developer but i've seen in a couple of places that
I am a predominantly PHP developer. I realize in this day and age specialization
I am a PHP developer but now I am learning asp.net with C# as
I'm a PHP developer . Let's just get that out of the way now.
I am not a PHP developer but I'm assessing the security of a PHP5
I'm not a PHP developer, but I'm currently hacking on an internal tool so

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.