Click to See Complete Forum and Search --> : Pass a variable to the url


the_hero
10-01-2008, 08:04 PM
I have a few java variables server side that i need to pass to the url to be able to use them client side, such as using them with javascript.

How can I pass a databean variable to the url?:confused:

Here is an example of my bean:

<%= response.encodeURL("DynamicPagesImagesGetServlet?") %><%= com.ideaorbit.database.DynamicPagesImagesDatabase.TABLE_FIELD_KEY_DYNAMIC_PAGES_IMAGES_ID %>=<%= ResponseBean.getDynamicPagesImagesID(i) %>
Please help!

Khalid Ali
10-03-2008, 03:16 PM
why you want to append it with url?
why not just create a value in the javascript?
Just remember JavaScript only happens when page is loaded, and java code happens on the server. Meaning you can load the page however you want to show.

<script>
var fromServer="<% java variable %>";
</script>