Hello Simon,

I did try out the code sample with lots (an I mean lots..) of skepticism, bu was 
shocked when I was a JOptionPane popup asking me for input !

My assumption was that the string representation of the JOptionPane would be displayed
e.g. bla bla bla
javax.swing.JOptionPane[,0,0,0x0,invalid,layout=javax.swing.BoxLayout,alignmentX=null,alignmentY=null,border=javax.swing.plaf.BorderUIResource$EmptyBord
erUIResource@19d1,flags=32,maximumSize=,minimumSize=,preferredSize=,icon=,initialValue=,message=JOptionPane
message,messageType=PLAIN_MESSAGE,optionType=DEFAULT_OPTION,wantsInput=false]

But what happened instead was a JOptionPane popped up, asking me for my name, and when 
I did enter it, the page was rendered with the string
bla bla bla Sriram

How does this happen ?

Of course, I did have the Java 1.3 Plugin installed, but how can s


Sriram
5/18/01 8:29:00 PM, Simon Chia <[EMAIL PROTECTED]> wrote:

>i'm not saying that we need cool UI, i'm just supprize that servlet a server
>side programming can do such thing. without the help of applets
>here the code
>
>import java.io.*;
>import javax.servlet.*;
>import javax.servlet.http.*;
>import javax.swing.JOptionPane.*;
>
>public class SomeServlet extends HttpServlet {
>  public void doGet(HttpServletRequest request,
>                    HttpServletResponse response)
>      throws ServletException, IOException {
>       PrintWriter out = response.getWriter();
>
>    String display;
>
>    display = JOptionPane.showInputDialog("enter name");
>    out.println("bla bla bla " +display );
>
>  }
>}
>
>
>
>
>
>----- Original Message -----
>From: "Sriram Narayanan" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Friday, May 18, 2001 4:30 PM
>Subject: Re: Servlet with Swing
>
>
>> If you want to display "cool"User interfaces on the browser side, then use
>Swing in applets. And since you insist on communicating with a servlet,
>communicate
>> using URLConnection.
>>
>> Really, servlets are intended for server side work, and can be used as
>such only, and not for cool UI's like you have been saying for the past few
>days.
>>
>> Sriram
>>
>> >Simon Chia wrote:
>> >
>> >> no no ... u can give it a try ur self.. i'm talking about servlets..
>not
>> >> applets, u can give it a try...
>> >> once the page loads, it loads the swing files also. u can use swing to
>get
>> >> user input and display it out on the screen.. u can even use to verify
>> >> username and password(something which i havent try).. its a world of
>wonder
>> >> u can try with swing and servlets.
>> >





_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to