Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes execute class form from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "execute class form from jsp" Watch "execute class form from jsp" New topic
Author

execute class form from jsp

Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
hi all,

I have a class named main_form.class that i would like to call on button click of my JSP page. How would i do that... any ideas...???

Please help..
[ March 20, 2005: Message edited by: Bear Bibeault ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Is your main_form Class a Servlet? If it isn't then you can't call it in respose to an HTTP request (your button click).


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
my main_form is a normal java class and not any servlet or JSP.


i dont know whether this would be the right approach but if i call the Runtime execution in my JSP and execute the program my passing the command line string to execue my java class file..then will it not work...?

I don't have much idea about it..

Is it possible that i make my java class file an exe .. and then run the exe on my button click in JSP...???
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

What does your main_form class do?
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

What does your main_form.class do ?
Surely there should be better approaches than invoking a java class that's not a servlet on form submit (if such is possible at all, in first case)

ram.
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489


Originally posted by Paul Sturrock
----------------------------------
What does your main_form class do?
----------------------------------


oops, looks like Paul beat me to it

ram.
Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
hi all,

ok..it was just some thing new that i was trying on a test basis and its working now.

I have this jsp page where their are many links and around 6 buttons. On each button click the page gets fwd to another JSP page. For the last button.. i.e. the change personal information button i wanted to call a GUI form which i created through the main_form.class ..
and in this form the users personal details are displayed where if he wants he can change it.

Well i have been able to call the class form on the button click in my JSP.
Now im facing only one problem .. hope some one out there can help me..

When i click on the button, the form is opened, but it doesnot come as the top most form. It is minimized. But on subsequent click on the Button that is there in my JSP, the form is displayed on screen.

Can any one tell me, how can i make my class form to come in front of the user, rather than it being displayed in minimized way.

Thanxs
Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
Im facing another problem. When i click on the JSP button on MY pc ... every thing seems to be working fine, but now when i try to access the JSP page from another persons PC.. then , at that time, If i try to access the GUI form, it opens on MY PC and not on the users Pc. Y is it so..???

Please help..!
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

If you want to combine a Java GUI (Swing or AWT) with HTML in a web environment, you will need to use applets. It's working on your own machine because the webapp and the gui code are on the same machine. How would a client fire up a GUI screen if the application is not on their machine?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Rekha Pande
Ranch Hand

Joined: Jan 29, 2004
Posts: 145
Ok let me try doing it from an applet...and see what happens...!
 
 
subject: execute class form from jsp