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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:21:40+00:00 2026-05-26T21:21:40+00:00

I have a unique scenario where I’m using a servlet to dynamically output to

  • 0

I have a unique scenario where I’m using a servlet to dynamically output to the browser with calls to a database. The content type is RSS-XML so that it can update an RSS feed xml from the database. This is working fine. However, I also have a an EJB that is accessable as a webservice @WebService. So that all of it’s public methods are accessible via SOAP transactions. I have successfully implemented this as well. So that I am updating the database through Java-WS/SOAP, my problem is that I am not simultaneously updating the doGet() of the servlet which means it’s not updating the Servlet call–even though the Database is successfully updated.

How do I force a doGet() call to my servlet from an EJB? The only way those HTML/XML tags will be updated is if the Servlet is called and therefore the doGet() method.

Thank you.

EDIT for clarity: My Servlet currently is accessed from a jsp page as a URL. It’s referenced as a link that people can click on. It updates fine once people click on it but since it is an RSS feed I would also like to be able to call/update the feed when I add data to the database. So far I can add data but the feed is not being updated because I don’t know how to call the doGet() in my business logic.

This is what the pertinent part of my servlet looks like:

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws     ServletException, IOException {

    Statuses = rssbean.arrayUpdates();

    XMLOutputFactory factory = XMLOutputFactory.newInstance();
    try {
        XMLStreamWriter writer = factory.createXMLStreamWriter(response.getOutputStream());
        response.setContentType("application/rss+xml; charset=UTF-8");


        writer.writeStartDocument();
        writer.writeStartElement("rss");
        writer.writeAttribute("version", "2.0");
        writer.writeStartElement("channel");
for(int i = 0; i < (Statuses.length); i++){
                writer.writeStartElement("item");
                    writer.writeStartElement("title");
                        writer.writeCharacters(Statuses[i]);
                    writer.writeEndElement();
                    writer.writeStartElement("link");
                        writer.writeCharacters("http://www.link.com");
                    writer.writeEndElement();
                    writer.writeStartElement("description");

                    writer.writeEndElement();
                writer.writeEndElement();

As you can see I’m creating this .rss file on the fly through doGet(). This works fine when you link to it but I’m not sure how to run these writer calls from my EJB (not the browser).

  • 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-26T21:21:41+00:00Added an answer on May 26, 2026 at 9:21 pm

    Your rssBean.arrayUpdates() need to query the database and return the result each time. If it is returning some pre-existing data, then that wont work.

    Once you click on a link and access a servlet, the servlet pulls the information from the database and gives the result to the client.

    When you update your data through the web service, there is no need to make a call to the servlet to make sure it is updated, as you seem to expect to do.

    HTTP is request / response. Once a response has been given to the client, then they would have to refresh the page or click on the link to refresh the content.

    see also HTTP headers for cache control http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

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

Sidebar

Related Questions

My Scenario, Im using asp.net 2.0 .I have Site where it creates a unique
I have an SQL database with a set of tables that have Unique Id's.
I have a temporary table that I'm using and I have a unique column,
I want to model the following scenario in the database: I have a Package,
Scenario I have a stored procedure written in T-Sql using SQL Server 2005. SEL_ValuesByAssetName
I have the following scenario: class A with bean-a in wireup.xml class B extends
The Scenario: I have the following (simplified) database table scenario: ID ProductName ProductCategory Colour
I have quite unique situation. Here is my scenario: 4 thumbnails linking to the
I have the following scenario: I need to figure out the unique list of
I have a scenario. Can this be done using one query ? Table Company

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.