File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Using script variables in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Using script variables in JSP" Watch "Using script variables in JSP" New topic

Using script variables in JSP

vivek ja
Ranch Hand

Joined: Feb 24, 2005
Posts: 80
I am setting a boolean variable using javascript.
Based on that variable, I want to instantiate a class in JSP.
Is it possible to do that?

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

It is not. Javascript executes on the client long after the JSP has been executed on the server and the resulting HTML page has been sent to the browser.

[Asking smart questions] [About Bear] [Books by Bear]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410


Maybe if you can describe what it is you're trying to do, someone could recommend an approach that would help you.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Using script variables in JSP
It's not a secret anymore!