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

    Join Date
    Jun 2003
    Posts
    8
    Rep Power
    0

    Question how to pass a javascript variable a parameter to a bean's method call


    hello all,

    in my jsp page i have to call a bean function.the function's parameter must be a javascript variable.

    something like this,

    var prcsstring=<%=buildpg.getprcs(%>projname+","+lyrname<%)%>;


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

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    You can't mix java and javascript. The only way to make that work is to put the values from your javascript variables into a form, submit the form to the server, then pass the values to your bean methods using request.getParameter().

    (Note: If you don't want to use a form, you can put the javascript values into the querystring).
    -james

IMN logo majestic logo threadwatch logo seochat tools logo