Bookmark Topic Watch Topic
  • New Topic

Calling JSP from Java class  RSS feed

 
Hemang Joshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi All,

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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
JSPs are not like Java methods that you can just call from anywhere in a Java program. What is it that you are really trying to accomplish?
 
Hemang Joshi
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am updating existing code and would like to keep new jsp to cater the new requirements.

I thought that i would keep all new requirements in new class which i call from existing system and this new class will then call JSP. I can make database connection and get the required data from database which i can then pass to JSP but, i need HTTP objects for which I don't have.

I have no idea from where to start. Second thoughts was to writedown servlet but, again the existing system doesn't have servlet so there would be problem in getting HTTP objects.

Is there any workaround to have solution of it.

Thanks,
Hemang
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
I just noticed that this is not the first time that you have posted this question. Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.
[ October 07, 2007: Message edited by: Bear Bibeault ]
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!