Greg

Thanks for the quick reaction
I will try it this way and see if it works fine
Is it also possible through this to do a file transfer bu your knowledge
(When they selected a file to be transfered over a Visual Basic program)
I know normally i would not do this, but some people where asking this in
specific.
Can you also send me a piece of your code as a reference

Thank you very much

Martin Kuypers

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 31, 2002 4:34 PM
Subject: RE: How to connect a COM environment to struts ?


> So VB is your front end and you want it to connect to business logic in
> Struts, right?
>
> We've used a browser control with some success to do this sort of thing.
> I think it ships with VB in the "Microsoft Internet Controls" package,
> but I'm not real sure.  The variable is of type "SHDocVwCtl.WebBrowser".
> Just place it on a VB form and you can use it to communicate with a web
> server via HTTP.  The browser control has three events that our code
> catches: CommandStateChange, DocumentComplete, and BeforeNavigate2.  It
> has a lot of other events and methods on it.  You'd have to read the doc
> b/c I'm not really sure what they are for.
>
> At any rate, the way we're using it is to create the url, create the
> HTTP Post request, create the headers and pass it into the control like
> this:
>
>    Dim Browser As WebBrowser
>    Dim Url As String
>    Dim PostData() As Byte
>    Dim Headers As String
>
>    Url = http://localhost/someapp/someaction.do
>
>    PostData = "param1=value&param2=value..."
>
>    ' not really sure what this line is for...
>    PostData = StrConv(PostData, vbFromUnicode)
>
>    Headers = "Content-Type: application/x-www-form-urlencoded" & vbCrLf
>
>    Call Browser.Navigate(Url, 0, "", PostData, Headers)
>
> After this you have two choices.  The browser control can either display
> the HTML output or you can display the output in VB forms.
>
> To accomplish the latter, you would have to make the browser control
> invisible, and your JSP's would have to be written to produce XML
> instead of HTML.  When the browser control returns from the web server,
> you have access to the DOM by getting a reference to Browser.Document
> (this is of type HtmlDocument).  So from that you can traverse the
> response XML to get data to populate your VB form.  Of course you can
> use Struts logic and bean tags to populate the XML in the JSP.
>
> There may be other (better) ways of doing this, but that's how we
> achieved a similar effect.
>
> HTH,
> Greg
>
>
>
> > -----Original Message-----
> > From: Martin Kuypers [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, July 31, 2002 2:39 AM
> > To: [EMAIL PROTECTED]
> > Subject: How to connect a COM environment to struts ?
> >
> >
> > Does anyone have an example how a visual basic program can
> > connect to a
> > struts environment, because i have all the Bussines Logic in
> > a Struts MVC
> > model and would not like to change it
> > So if anyone has an example about a visual basic program
> > connecting to this
> > world, then this would mean a big Help for me
> >
> > Thanks
> >
> > Martin
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> >
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to