Struts - replacing ActionServlet

Posted on 2003-11-09
Last Modified: 2010-04-01
Has anyone managed to replace ActionServlet successfully? I've tried to do this by editing web.xml:


and then putting the subclass ActionsServlet into WEB-INF/classes. No go - different error messages depending on the application. Any ideas?
Question by:CEHJ
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 15

Accepted Solution

jimmack earned 105 total points
ID: 9710512
If you're using Tomcat, I think there is an issue with servlets that are not in packages.
LVL 86

Author Comment

ID: 9710669
OK - i'll give it a try
LVL 86

Author Comment

ID: 9711236
I think you may be right, although the main problem was that the class was not marked pu blic (Doh - i used a 'class wizard').

A sub-question, so i can give you the points: where *does* this output go:

>>log.debug("Calling init() in custom ActionServlet...");

This appears in web.xml:

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 15

Expert Comment

ID: 9711259
Err. I'm not certain.

A normal line like

   log("This is a log message")

Is written to the logger that you set up in the server.xml file inside the <Context> for your webapp, eg:

        <Context path="test" docBase="test" debug="0" reloadable="true">
          <Logger className="org.apache.catalina.logger.FileLogger"
                  directory="webapps/test" prefix="testlog." suffix=".txt"

In this case, it would be written to the file webapps/test/testlog_2003_09_11.txt

I'm hesitating here because I haven't used log.debug().

If you don't set up the log file, then I'm not exactly sure where it goes :-(  System.out.printlns go to catalina.out in the /logs directory.

Does this help?
LVL 86

Author Comment

ID: 9714458
Not really - well, a bit. I'm going to have to find out how all these logging apis cooperate (or don't). What an utter pain for something that's meant to help *maintain* code!

Don't take this the wrong way Jim, but i don't think you've *quite* earned your points yet ;-)Maybe i'll keep this one open for a short while - there's bound to be a Struts newb question that I'll have to ask that'll be the clincher for you - OK?
LVL 15

Expert Comment

ID: 9714502
LVL 14

Assisted Solution

kennethxu earned 20 total points
ID: 9719732
struts use jakarta common logs. it can be configured to use log4j or j2sdk1.4 log.
LVL 86

Author Comment

ID: 9720980
Yes - thanks for that kenneth - i'm getting under the covers with that now anyway, but... a few points for your confirmation ;-)

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Justin
In light of the WannaCry ransomware attack that affected millions of Windows machines, you might wonder if your Mac needs protecting. Yes, it does and here is how to do it.
In this blog we highlight approaches to managed security as a service.  We also look into ConnectWise’s value in aiding MSPs’ security management and indicate why critical alerting is a necessary integration.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL ( and MongoDB (…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question