Yes VAJ/WTE is a pain, but it is ok to have the same configuration in the
webapp file and the web.xml file.

Like this...

<servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>

and the actual servlet definition, etc.   If you deploy WAS 3.5.x running
in compatibility mode you have to do the same kinda thing in that
environment.   Everything will work in the end though.

Tim




                                                                                       
                                                       
                    "Craig R.                                                          
                                                       
                    McClanahan"                                                        
                                                       
                    <craigmcc@apa                                                      
                                                       
                    che.org>                                                           
                                                       
                                                                                       
                                                       
                    07/11/2002    To: Struts Users Mailing List 
<[EMAIL PROTECTED]>                                              
                    01:10 PM      cc:                                                  
                                                       
                    Please                                                             
                                                       
                    respond to                                                         
                                                       
                    "Struts Users                                                      
                                                       
                    Mailing List"        Subject:     Re: WEB-INF/web.xml hardcoded in 
initServlet() [struts 1.0.2]                           
                                                                                       
                                                       
                                                                                       
                                                       



Caterpillar: Confidential Green          Retain Until: 08/10/2002
                                         Retention Category:  G90 -
                                         Information and Reports






On Thu, 11 Jul 2002 [EMAIL PROTECTED] wrote:

> Date: Thu, 11 Jul 2002 17:40:38 +0200
> From: [EMAIL PROTECTED]
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: WEB-INF/web.xml hardcoded in initServlet() [struts 1.0.2]
>
> Hi !
>
> I am using Struts 1.0.2 under Visual Age for Java 3.5.3 and Websphere
Test
> Environment ; the architecture is not fully J2EE. In particular, WTE does
> not parse the WEB-INF/web.xml file but another file with a similar syntax
> (xxx_app.webapp) : this is where it finds the mappings for the servlets
> (*.jsp -> jasper ; *.do -> Struts for instance).
> Unfortunately, the WEB-INF/web.xml file is hardcoded in the initServlet()
> method of the ActionServlet class ; it seems that this method parses the
> file to store the mapping of the current servlet. This code, in my
> environment, fails, but since a catch Throwable is done, the process goes
> on. But, the ServletMapping variable has not been valued.
> So, my question is : though everything seems to be working all right, am
I
> to expect a problem because of this ? And, subsequently, why does the
> controller servlet need to know the original mapping, since this topic is
> handled by the servlet container ? Can I go on in this situation without
> fearing a future problem ?
>

Struts needs to know which mapping is used so that it can construct an
appropriate URL for <html:form> links where you specify the action path
only in the "action" parameter.  For example, if your struts-config.xml
says:

  ...
  <action path="/foo" .../>
  ...

and your JSP says:

  <html:form action="/foo" ...>

then Struts needs to know what extension to add (if you do extension
mapping) or what path prefix to stick on the front (if you are using path
mapping).

Struts is designed to operate only in containers that are compliant with
the specifications.  I'm not really interested in making accomodiations
for things like this -- I would suggest that WTE be changed to use the
standard deployment descriptors.

In the mean time, can you just ensure that the mapping is defined in both
files?



> Thanks for any explanation.
>
> Olivier Schmeltzer
>

Craig


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






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

Reply via email to