Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Objects passed Java Applet/JSP pages

Status
Not open for further replies.

BZJavaTalk

Programmer
Jun 23, 2004
4
US
Here is a really triva question for all the Exports.

I have written JSP pages on my Web Server that have HTML, Java Beans, and JavaScript embedded within. I am looking at adding a Java 2 Swing Applet to the JSP page also. This I know how to do and even add the Plug-IN for Suns JVM so the Applet can run in the Client Browser.

What I am trying to figure out is how to send an object (data collected by the Applet controls that the user entered) back to the JSP page so the Bean can update the information on a SQL database. Collecting the data and creating the object is no problem and updating the data found in the object to a MS SQL database via stored procedures is not a problem and I can do that in my beans. I can pass a string or an integer by calling Applet methods from JavaScript, but has anyone done this with Objects? Can I pass Arrays or Vectors? Also, how can I pass the object data from JavaScript to my JSP bean. It seams that there is no way to update the server side variables in the JSP from JavaScript? My clients would be using Netscape 4.0 or higher or MS Internet Explorer 5.0 or higher. Do any experts out there have any suggestions?

Before I started using JSP pages, I wrote an Applet communicating with an Servlet, but I do not want to use servlets for this communication. I was able to write a stream of objects between Servlets and Applets. I really am looking at going from Applets to my web page JSP beans.

Any feedback is very much appreciated.
 
Well if you can commmunicate between an applet and servlet, then you can communicate between an applet and a JSP, as JSPs are basically servlets once compiled ...

--------------------------------------------------
Free Database Connection Pooling Software
 
Yes I know JSPs are compiled into Servlets. But I want to be able to add the code to do this in the JSP. I don't want to have to deal directly with a Servlet, but my web server compiles the JSP page and handle it. The JSP gets recompiled everytime it is changed. Besides it is compiled, I can't get to the Servlet java code for the JSP page.
 
Well, just add the code you wrote in the servlet into the JSP ...

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top