• Post Reply Bookmark Topic Watch Topic
  • New Topic

Anybody know how to do this...  RSS feed

 
Chickoo Chick
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i have been searching for a solution for a day now and no clue even after tons of googling...

I need to give the user to click on a link and the browser and the user is able to preview the html content in the choosen browser. This means that the user may not have that browser installed on his machine but through my application, he can view in any browser for which i have provided an option.

I have seen this in a product i got a demo recently.

I think its some sort of browser engine or API but have no clue how to do it. Its very essential for my next version of application.

Any help will be appreciated.

Thanks
 
Scott Selikoff
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good question. Really good.

I don't know of such a API but it doesn't mean one does not exist. Its hard to say though how you encompass other browser engines, *especially* proprietary ones like IE, into your code without actually invoking them.

Good luck either way. My guess is the demo you saw was a simulation of some kind based on published standards.
 
Chickoo Chick
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I really think there is 'some kind of api' which i have to just find which can fire the browser on server level and produce the preview. But i am clueless as to how and where such an api exists.

The product i saw the demo of is called Cummunicator Corp at
www.communicatorcorp.com

It had atleast 5 or 6 browsers in which the html mail could be previewed before being sent.

If we start thinking about the logic ... all we need is

- some sort of browser runt time
- firing mechanism
- capture the screenshot as an image or something
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, what an astonishingly evil product.

Anyway: IE's rendering engine is an ActiveX control -- it's designed to plug into other applications. I suspect that other Windows browsers adopt this same protocol, if possible, so they can replace IE. To use this from Java, you'd need to use JNI and a healthy helping of Windows programming know-how, or you'd have to buy one of the commercial Win32-API-for-Java tools. But in any event, this is mostly a Windows programming thing, not a Java thing per se.
 
Chickoo Chick
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm, i know close to nothing about windows programming. But the basic question is how the functionality of other browsers could be simulated at the server level.
 
Chickoo Chick
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about this ?

http://ajaxpatterns.org/System_Test

Browser Controller

Does anybody know how to use this? It talks about commercial available ones.
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably not what you want, but this code does a reasonable job of firing up the default browser on Win, Lin, Mac OS X.
 
Scott Selikoff
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ernest Friedman-Hill:
This is mostly a Windows programming thing, not a Java thing per se.


I'd tend to think the closest you can get in java is to write a browser simulator that could handle the basic web tags (and probably not javascript).
[ March 21, 2006: Message edited by: Scott Selikoff ]
 
Chickoo Chick
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks everybody, they are very helpful suggestions.

Firing the browser at the server level is one thing and capturing the result and show it in some ways to the user is another issue. I am really surprised that googling is not helping at all in this.

Do i really have to learn windows programming to achieve that? Are we talking about ActiveX technology or something else too?
 
Paul Clapham
Sheriff
Posts: 22719
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's this "server level" you keep asking about?
 
Chickoo Chick
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The different browsers api or 'something' would need to be present on the server so that the client using HTTP can invoke the different browser api to generate the preview. Otherwise how will the client who may have only one browser installed preview for 4 others?

Am i right in thinking this way?
 
Scott Selikoff
author
Bartender
Posts: 4093
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By the way, you shouldn't be too concerned with how a browser displays your page, I find its better to focus on coding to a standard format, and let the browsers ability to display that format win out overall (unless of course you've got a ton of javascript, then you're just ******)

Check out the W3C Validator: http://validator.w3.org/

Personally, I like XHTML 1.0 Transitional. I've found that a lot of the differences between browser displays was actually poorly formatted or bugged code that the browsers were resolving for you.
 
Chickoo Chick
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm thats quite right. The more browsers respect the 'validated markup' the less there is any need to worry about how different browsers display the markup.

But the truth is things are displayed differently quite often with css use.
 
ak pillai
author
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Scott. That is why I usually stay away from JavaScript.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!