Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Parameters from JSP to Main method of a Class  RSS feed

 
Sandeep. Oza
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am strucu at one point. There is one jsp page having some parameters. There is One Class with main method. Now I want to pass parameters from jsp page to this main method of Class and execute it?
Is it possible? There should be some way to do it. If anyone knows pl. explainor give tips.
Thanks in advance.
Good Day.
Sandeep Oza
 
Bosun Bello
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what youi are asking. Are you trying to pass variables from a JSP to a java application's main method? Remember that JSP communicates primarily via HTTP.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Main is just a method, like any other. Have you tried just calling it? Note that main takes a single parameter which is an array of Strings, so you might need to do something like:

I can't help thinking that needing to call main is a strong "code smell", though. Can you not refactor the lines from main into another method called by main, and also call that from your JSP?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!