Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calling jsp from java class and posting data  RSS feed

 
Hemang Joshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a class which accepts list objects from other system and I would like to post these objects to simple JSP to test. Other system calls postObjects() method and pass list objects and working ok.



Any idea what code to write to call JSP and post data in JSP?


Thanks in advance.

Regards,
Hemang

[BSouther: Added UBB CODE tags]
[ October 02, 2007: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two places to look:
http://jakarta.apache.org/commons/httpclient
and
http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLConnection.html

The former is a higher level API with a lot of the hard stuff already done for you.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Hemang Joshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ben.

This is not helping me because I am playing with plan java class not the servlet.

I have come across the problem where I need to call Class A from Class B and Class A should internally call JSP.

I am able to call Class A from Class B and populate the data what I want. I am not getting an idea how to call JSP from simple class. This is plain java class not the servlet hence I don�t have request object.

Any thoughts would be highly appreciated.

Regards,
Hemang
 
Adam Schaible
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've done this before, but with the Velocity engine - basically you want to use it as a templating engine?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!