1

I want to create a UI which invokes my python script. Can i do it using JSP? If so, can you please explain how ? Or can i do it using some other language. I have gone through many posts related to it but could not find much? please help me out? Explanations using examples would be more helpful.

Thanks In Advance..

heretolearn
  • 6,387
  • 4
  • 30
  • 53

3 Answers3

2

Calling Python in Java?

The above link shows how to call Python in Java

You just need to include to thing inside the jsp with <% %> Tag

Community
  • 1
  • 1
madhairsilence
  • 3,787
  • 2
  • 35
  • 76
1

It would be neater to expose your python API as RESTful services, that JSP can access using Ajax and display data in the page. I'm specifically suggesting this because you said 'JSP' not 'Java'.

Sree
  • 746
  • 6
  • 21
  • can you give some example or could you explain it a bit more. – heretolearn Jun 28 '12 at 12:15
  • May be this is not the ideal way. Here you will need to two web servers - one hosting Java and one hosting python. Jython is another option to mix Java with Python. – Sree Jun 29 '12 at 10:22
1

I think I would go with Jython, once properly configured, you can define a servlet that understand Python code.

You can read a reference here.

Edwin Dalorzo
  • 76,803
  • 25
  • 144
  • 205