This week's book giveaway is in the
General Computing
forum.
We're giving away four copies of
Arduino in Action
and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See
this thread
for details.
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Frameworks
»
Struts
Author
No Way to Put the init() Method Inside the ActionForward Execute() Method
JiaPei Jen
Ranch Hand
Joined: Nov 19, 2000
Posts: 1309
posted
Sep 17, 2004 12:13:00
0
We cannot put a method inside another method.
When using the Struts, we start with:
public final class MyClass extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) throws java.lang.Exception { ....... ....... } }
I have a void init( ...) { ... } method shown below. Of course, I cannot put this init( ... ) inside the ActionForward Execute( ... ) { ... }
What am I supposed to do? Do I put this void init( ... ) { ... } method before the ActionForward Execute( ... ) { ... } begins?
String smtpServer; public void init(ServletConfig config) throws ServletException { super.init(config); smtpServer = config.getInitParameter("smtpServer"); }
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4725
I like...
posted
Sep 17, 2004 13:30:00
0
Why are you trying to do this???
A good workman is known by his tools.
I agree. Here's the link:
http://aspose.com/file-tools
subject: No Way to Put the init() Method Inside the ActionForward Execute() Method
Similar Threads
Initialization for a JSP
Overriding both versions of init() method
getServletConfig() does not work
Compile error: class file contains wrong class, bad class file???
Why does it die after init()?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter