CEHJ
asked on
Struts - replacing ActionServlet
Has anyone managed to replace ActionServlet successfully? I've tried to do this by editing web.xml:
<!--<servlet-class>org.apa che.struts .action.Ac tionServle t</servlet -class>-->
<servlet-class>ActionsServ let</servl et-class>
and then putting the subclass ActionsServlet into WEB-INF/classes. No go - different error messages depending on the application. Any ideas?
<!--<servlet-class>org.apa
<servlet-class>ActionsServ
and then putting the subclass ActionsServlet into WEB-INF/classes. No go - different error messages depending on the application. Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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:
<init-param>
<param-name>debug</param-n ame>
<param-value>2</param-valu e>
</init-param>
<init-param>
<param-name>detail</param- name>
<param-value>2</param-valu e>
</init-param>
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:
<init-param>
<param-name>debug</param-n
<param-value>2</param-valu
</init-param>
<init-param>
<param-name>detail</param-
<param-value>2</param-valu
</init-param>
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.cata lina.logge r.FileLogg er"
directory="webapps/test" prefix="testlog." suffix=".txt"
timestamp="true"/>
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?
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.cata
directory="webapps/test" prefix="testlog." suffix=".txt"
timestamp="true"/>
In this case, it would be written to the file webapps/test/testlog_2003_
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?
ASKER
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?
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?
OK
;-)
;-)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes - thanks for that kenneth - i'm getting under the covers with that now anyway, but... a few points for your confirmation ;-)
ASKER