This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
hi all! it just seems like my ActionServlet subclass cannot get to the action class nor use the form bean for validation... i configured everything fine.. i dont get any significant error messages..i put logging statements inside my ActionForm's validate() method and my Action's execute() method, but it never gets there!
i get a 404 - file not found error on my browser ..thats bad
I suspect there may be something wrong with your class that extends ActionServlet. Any methods you override should call the superclass's implementation of the method before proceeding with their own extension of the logic.
It might be helpful to show us the method that you are overrriding.
The other question is: Why are you overriding ActionServlet in the first place? Doing this is kind of an extreme measure that you adopt only after you've tried and failed to get Struts to do what you want it to. There are usually other less extreme measures you can take to get the desired result. [ June 10, 2005: Message edited by: Merrill Higginson ]
make sure you changed your web.xml servlet mapping to the right package name and servlet name. i do agree with merrill on extending this core component of struts. this should only be done when absolutely necessary.
i have 1 app in which i do this to inherit form bean definitions declaratively. i used to do my authentication/user profile set up in the custom ActionServlet also, but i pulled that out into a Filter. [ June 10, 2005: Message edited by: alan do ]
-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
Joined: Mar 17, 2004
hi, thanx for your replies..ehm i got it round .. it was just a wrong url in the calling jsp's form :roll: i mean i wrote <form action="select.do"> instead of <form action="../select.do"> ..im new to web dev so its kind of weird all this syntax..
anyway i subclassed ActionServlet cause i needed an entry point for configuring my logger (im using log4j), so i overrode init() in order to call PropertyConfigurator.configure() ..is it really so bad? (i thought that ActionServlet's init() was a good place) is there another/better way to do so (if you know of one please tell me)
how can you tell struts where to find log4j's properties file?
thanx again [ June 10, 2005: Message edited by: Lukas Alamar ]
Joined: Apr 14, 2005
uh...put that in another servlet, say StartUpServlet, and add the servlet to to the web.xml. this way you can do other things at start up while leaving the ActionServlet alone.
Joined: Mar 17, 2004
ill do that.. looks smarter (nice site) [ June 11, 2005: Message edited by: Lukas Alamar ]