Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

JSP - Servlet - Question

Options
  • 10-02-2008 6:52pm
    #1
    Registered Users Posts: 1,821 ✭✭✭


    Right, I'll try explain this properly... I got a JSP page on the front end, have it sorting all my sessions and stuff like that. Working fine. I have a servlet which creates objects - i want to display these items on the jsp (simplifying it), but I dont want to pass the values over the session variables and creating scriptlets would be a big no no. If I do send the variables over the session or the request, the objects can become exponetially large... Which would probably kill my server :) Can anybody help me with this? I dont really want to use the servlet to display the page... but if i have to I guess I will.

    However, is there a way maybe I could use ajax or something to call the methods or actions of the servlet and display it on the client side? kinda in the same way jsp include or something along those lines?


Comments

  • Users Awaiting Email Confirmation Posts: 351 ✭✭ron_darrell


    Emmmm there are a number of ways I guess. What are the objects though and that would help me narrow it down a bit.

    -RD


  • Registered Users Posts: 1,821 ✭✭✭Skud


    the object is a SyndFeed from the Rome api http://wiki.java.net/bin/view/Javawsxml/Rome05TutorialFeedReader

    i want an aggregator running when someone logs in. Have the servlets and handler to call my database in bg.

    Goes like

    JSP
    Servlet
    handler and beans
    db


  • Users Awaiting Email Confirmation Posts: 351 ✭✭ron_darrell


    Ok - haven't a huge amount of experience with ROME but I would suggest that rather than storing/sending the data that's being created by the feed to just store/send a reference to it. Have a function on your page then using this reference to pull down the data. Alternatively, as the data is being pulled from the feed, store it in a database. The JSP pages then just need to access the database.

    Sorry, the answers are still a bit vague. If you have sample code/sample feed data then I can take a look at it and offer a more concise answer.

    -RD


  • Registered Users Posts: 1,821 ✭✭✭Skud


    thanks man, i just wanted to get an idea of how to do it rather than have someone help me with it :) hence the generalization. That helped alot


  • Registered Users Posts: 378 ✭✭sicruise


    Use a Controller Servlet to handle your page requests ... retrieve all relevant details and forward the request/response to the jsp for display?? Why are you affraid of servlets... and btw you could always just include your code in the jsp... but i don't like that. :cool:


  • Advertisement
  • Closed Accounts Posts: 362 ✭✭information


    Skud wrote: »
    Right, I'll try explain this properly...
    I got a JSP page on the front end,

    A jsp is a servlet so you cannot have it on the front end it is a serverside component

    This is how it should be done
    jsp to create html page
       |
    request
       |
      \/
    servlet -  calls business object to do your stuff - adds info to request
       |
    request dispatcher
       |
      \/
    display jsp
    


  • Registered Users Posts: 378 ✭✭sicruise


    We all knew what he meant... stop being pedantic.


Advertisement