File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Calling a JSP using Swing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Calling a JSP using Swing" Watch "Calling a JSP using Swing" New topic
Author

Calling a JSP using Swing

Sudharshan Reddy Ch
Ranch Hand

Joined: Jul 12, 2006
Posts: 36
Hi all,

How can i call a JSP page using Swing.

Thanks,
Sudha C Reddi


Cheers,
Sudha C Reddi
http://techelp.in
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
What do you mean by "calling" a JSP? Do you want to write some kind of browser or something?


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

If you need to just process a JSP that exists on a server for the purpose of getting some info back or processing some server side logic, you can use an HttpURLConnection.

If you want to process a JSP inside an embedded browser in your app, you'll need to look at the JEditorPane. Or you can google for other libraries that allow you to embed a native browser in your Swing application and such.


GenRocket - Experts at Building Test Data
Sudharshan Reddy Ch
Ranch Hand

Joined: Jul 12, 2006
Posts: 36
When i click a button it should open a browser, and it should open a URL that calls a JSP page in that particular browser.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41808
    
  62
Eric Alberts BrowserLauncher class is a cross-platform way to launch a URL in a browser.


Ping & DNS - my free Android networking tools app
Sudharshan Reddy Ch
Ranch Hand

Joined: Jul 12, 2006
Posts: 36
I got it. Thanks to all. I used Ostermiller.util utility.

http://ostermiller.org/utils/Browser.html

Cheers
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Notice that this is not at all a Swing question...
johny sill
Greenhorn

Joined: Jul 08, 2006
Posts: 27
otherwise u can use

import java.net.*;

void NewWindow()
{
try{
URL url=new URL("http://google.co.in");
AppletContext context=getAppletContext();
context.showDocument(url,"_blank" );
}
catch(Exception e)
{
e.printStackTrace();

}

}
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41808
    
  62
Note that Johny Sills suggestion only works in applets.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling a JSP using Swing