×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    5

    Smile Displaying out plain text from servlet via widget

    Hi, i would like to ask for advice in this area. I am new to widgets and had come across a project that used the Nokia WRT with aptana studio. I would like to ask if there are any methods we can read the processed content from a servlet?

    I am working on a RSS feeder which actually display out news through the servlet instead of getting news directly from the URL.

    The content that is processed out from the servlet are plain text.

    So, how could i actually get the plain text from the servlet via the RSS in Nokia WRT?

    Thank You.

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Displaying out plain text from servlet via widget

    Hi jerzelleLim2009,

    you can check out the "RSS Reader Widget project" sample that is shipped with the Aptana WRT plugin. There you can find all the code you need to read and display text taken from a RSS feed. Basically, what you have to do is:

    * request your feed URL with an XMLHttpRequest object
    * navigate the items contained in the response XML, taking all the informations you need to display
    * put the textual info you want to display inside HTML elements (e.g.: divs, spans, etc..)

    Just ask if you need any further help.

    Pit

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    5

    Re: Displaying out plain text from servlet via widget

    Hi Pit,

    Thanks for the suggestions. If the content passed is not in XML format but plain text format,how can i code the RSS Reader to put the textual info to display inside HTML elements?


    jerzelleLim2009

  4. #4
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Displaying out plain text from servlet via widget

    Hi jerzelleLim2009,

    to deal with text responses, instead of using the request's responseXML property, just use the responseText one.

    Pit

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    5

    Re: Displaying out plain text from servlet via widget

    Hi Pit,

    Finally manage to solve it already. Thanks for the advice. Btw, do you have any idea how to hide the updateFrequencyOption where i fixed a time and not let the user choose?

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,405

    Re: Displaying out plain text from servlet via widget

    Hi,

    you should set 'feedUpdateFrequency' variable to the frequency you've chosen and then, to hide the frequency setting menu, it should be enough to comment out this lines (all these changes are is RSSReader.js):
    Code:
    settingsView.addControl(feedUpdateFrequencySelection);
    and:
    Code:
    feedUpdateFrequency = (selectedFrequency != null) ? selectedFrequency.value : -1;

    Hope it helps,
    Pit

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    5

    Re: Displaying out plain text from servlet via widget

    Hi Pit

    do you have any idea on how to hide the whole menu and when i open the application, it will straight away load the feed and display the content?


    Thanks in advance,
    jerzelleLim2009

Similar Threads

  1. send/receive text data to/from java servlet
    By amipatel in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2009-01-16, 10:56
  2. Replies: 0
    Last Post: 2004-11-24, 18:49
  3. HELP! Error with plain text in MMS
    By jespana in forum General Messaging
    Replies: 2
    Last Post: 2003-10-30, 10:07
  4. HELP - Displaying simple text in a dialog/popup
    By darkenvy in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-05-21, 05:36
  5. Plain text concatenation
    By Jorrti in forum Smart Messaging
    Replies: 0
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •