1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Rep Power

    Accessing Javascript Variables from JSP

    I am using some JSP code in a web page which accesses a JavaBean and is returned some value.
    I need to be able to get the selected value from a select (list) and pass this to the JavaBean which will return a Vector of Objects I can use to display.

    The problem is getting the selected value from the list to the JSP code which calls the bean.
    I can use JavaScript to get the value, but then I have no way to get that to the JSP code.
    Is there any way to set a session value using Javascript, so then i could get it back in the JSP?

    any suggestions?

    the code looks something like this:
    funciont doSomething(value){
    Vector cour = admin.getCoursesInDept("THIS IS WHERE I NEED THE JAVASCRIPT VALUE");

  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Sacramento, CA
    Rep Power
    You're getting the value from the form, yes? Form values are accessible from the request object, referenced by the name attribute. So a select list with name="department" would be accessed with:
    request.getParameter( "department" );

IMN logo majestic logo threadwatch logo seochat tools logo