Re: why hardcode the path of web.xml?

2006-10-20 Thread Christopher Cheng
The reason is that I can use different configuraiton files for different 
instances.
Anyway, I have modified ActionServlet myself and it is working fine.


-- 
Christopher Cheng
Jerome Gagner [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 If you are using the resin-specific configuration options, you should
 just separate that out into a resin-conf.xml.


 What larry said, why do you want to do that?

 On 10/18/06, Christopher Cheng [EMAIL PROTECTED] wrote:
 I am using version 1.3.5 and found out that that path of web.xml is hard
 coded at line 1723

 InputStream input =
 getServletContext().getResourceAsStream(/WEB-INF/web.xml);

 In resin, I use config-file to change the path of web.xml for example
 config-filemyapp-web.xml/config-file. As I start the application, the
 servlet crashes of course.
 In the mean time, I have added the following to ActionServlet to get 
 around:

 String configWebXml = 
 getServletConfig().getInitParameter(configWebXml);

 if (input == null) {
 input = 
 getServletContext().getResourceAsStream(configWebXml);
 }

 Could anybody fix this or everybody is already using Struts2?





 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

 




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



why hardcode the path of web.xml?

2006-10-18 Thread Christopher Cheng
I am using version 1.3.5 and found out that that path of web.xml is hard 
coded at line 1723

InputStream input = 
getServletContext().getResourceAsStream(/WEB-INF/web.xml);

In resin, I use config-file to change the path of web.xml for example 
config-filemyapp-web.xml/config-file. As I start the application, the 
servlet crashes of course.
In the mean time, I have added the following to ActionServlet to get around:

String configWebXml = getServletConfig().getInitParameter(configWebXml);

if (input == null) {
input = getServletContext().getResourceAsStream(configWebXml);
}

Could anybody fix this or everybody is already using Struts2?





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: why hardcode the path of web.xml?

2006-10-18 Thread Wesley Wannemacher
A quick search of the servlet spec doesn't mention web.xml as being
configurable. In fact, page 70 suggests that the contents of 'WEB-INF/'
should include it. If you choose not to call it 'web.xml' and place it
in 'WEB-INF/' that's really your choice, but I wouldn't expect
portability. 

-Wes 

 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] On Behalf Of Christopher Cheng
 Sent: Wednesday, October 18, 2006 1:22 PM
 To: user@struts.apache.org
 Subject: why hardcode the path of web.xml?
 
 I am using version 1.3.5 and found out that that path of 
 web.xml is hard 
 coded at line 1723
 
 InputStream input = 
 getServletContext().getResourceAsStream(/WEB-INF/web.xml);
 
 In resin, I use config-file to change the path of web.xml 
 for example 
 config-filemyapp-web.xml/config-file. As I start the 
 application, the 
 servlet crashes of course.
 In the mean time, I have added the following to ActionServlet 
 to get around:
 
 String configWebXml = 
 getServletConfig().getInitParameter(configWebXml);
 
 if (input == null) {
 input = 
 getServletContext().getResourceAsStream(configWebXml);
 }
 
 Could anybody fix this or everybody is already using Struts2?
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: why hardcode the path of web.xml?

2006-10-18 Thread Larry Meadors

Why in the name of all that is right in the universe would you name
your web.xml something else? Obfuscation?

Larry


On 10/18/06, Christopher Cheng [EMAIL PROTECTED] wrote:

I am using version 1.3.5 and found out that that path of web.xml is hard
coded at line 1723

InputStream input =
getServletContext().getResourceAsStream(/WEB-INF/web.xml);

In resin, I use config-file to change the path of web.xml for example
config-filemyapp-web.xml/config-file. As I start the application, the
servlet crashes of course.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: why hardcode the path of web.xml?

2006-10-18 Thread Jerome Gagner

If you are using the resin-specific configuration options, you should
just separate that out into a resin-conf.xml.


What larry said, why do you want to do that?

On 10/18/06, Christopher Cheng [EMAIL PROTECTED] wrote:

I am using version 1.3.5 and found out that that path of web.xml is hard
coded at line 1723

InputStream input =
getServletContext().getResourceAsStream(/WEB-INF/web.xml);

In resin, I use config-file to change the path of web.xml for example
config-filemyapp-web.xml/config-file. As I start the application, the
servlet crashes of course.
In the mean time, I have added the following to ActionServlet to get around:

String configWebXml = getServletConfig().getInitParameter(configWebXml);

if (input == null) {
input = getServletContext().getResourceAsStream(configWebXml);
}

Could anybody fix this or everybody is already using Struts2?





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]