aspose file tools
The moose likes Struts and the fly likes calling a action class method from JSP in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "calling a action class method from JSP in struts" Watch "calling a action class method from JSP in struts" New topic
Author

calling a action class method from JSP in struts

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 602
Hello all,,

In struts how do I call a method in the action class from the JSP?

Thanks,
trupti
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
You don't. You assemble a form or hyperlink to the action and invoke it via an HTTP POST or GET operation. PLEASE do not try to invoke a method in an action class directly from a JSP! This ties your view directly to your controller, and suddenly you might as well not be using MVC at all!


"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: calling a action class method from JSP in struts
 
Similar Threads
Session problem in Struts and Tomcat
Trigger action on combo change
How to pass value from .java to .jsp in struts.
Struts 2 welcome-file-list
Struts- Error while java.lang.IllegalArgumentException: setAttribute: name parameter cannot be null.