Computing.Net > Forums > Web Development > JSP + fortune

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

JSP + fortune

Reply to Message Icon

Name: deity_me
Date: July 1, 2004 at 21:24:10 Pacific
OS: Slackware 10
CPU/Ram: P2 400
Comment:

Hi
I'm running my site on a Linux server and i
want my JSP to run a command called fortune
and display the output of that command on a
webpage.

Anyone here know how to do that?

Money not an issue?
Where do you live and when are you not home?
I'm not gonna rob you, I'm just gonna steal some stuff



Sponsored Link
Ads by Google

Response Number 1
Name: gpp
Date: July 2, 2004 at 05:48:34 Pacific
Reply:

Should look something like this....

Process p = Runtime.getRuntime().exec("fortune");

BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));

while ((s = stdInput.readLine()) != null) {
System.out.println(s);
}


0

Response Number 2
Name: deity_me
Date: July 3, 2004 at 16:15:18 Pacific
Reply:

I'll give that a try
thanks for the suggestion

Money not an issue?
Where do you live and when are you not home?
I'm not gonna rob you, I'm just gonna steal some stuff


0

Response Number 3
Name: Sanjaya Sugiarto (by Sanjaya)
Date: July 9, 2004 at 23:05:36 Pacific
Reply:

I believe, you need a RDF or XML from the site. Than you can write Java app to connect and check this RDF file. Than parse it.

Unfortunately, I cant find any RDF/XML service from Fortune.com, perhaps you have more luck than me.

San


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: JSP + fortune

including .js file into jsp page www.computing.net/answers/webdevel/including-js-file-into-jsp-page-/2794.html

.jsp webpage is not loading. www.computing.net/answers/webdevel/jsp-webpage-is-not-loading/907.html

URL rewrite in JSP www.computing.net/answers/webdevel/url-rewrite-in-jsp/2201.html