Creating Struts Plugin
Hi,
I am working on an example from chapter 4 of the "Professional Jakarta Struts" book ISBN 0-7645-4437-3, pages 84-86. The problem I have is getting the WroxPlugin (implementing Plugin) to read a property file called props.txt.
I revised the code:
File file = new File("PATH TO PROPERTIES FILE");
to
File file = new File("props.txt");
where props.txt has the content name=crystal
When I deployed and ran this web app, I have the following exception:
javax.servlet.ServletException: ch04\props.txt (The system cannot find the path specified)
ch04.WroxPlugin.init(WroxPlugin.java:49)
org.apache.struts.action.ActionServlet.initModuleP lugIns(ActionServlet.java:1158)
org.apache.struts.action.ActionServlet.init(Action Servlet.java:473)
javax.servlet.GenericServlet.init(GenericServlet.j ava:261)
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683)
java.lang.Thread.run(Unknown Source)
...I assume it had to do with the placement of the props.txt which I was not sure where to put it, so I put it in every sub directory in this web app. Yet, I still have the same error. I really stuck now, please help me. Any suggestion is appreciated.
Thank you,
Crystal
|