[EMAIL PROTECTED] wrote:

>  Hi There:
>  I get a question regarding for the struts structure.
>
>  We have existing web based software have our own structures.
>
>             Root
>
>                        Bin
>
>                         Classes (Class files)
>
>                         Docs
>
>                         Src
>
>                         Web (JSP pages)
>
>                         Runtime
>
>                         Conf (Configuration files)
>
>                         Lib (Library)
>
>                         Logs
>
>  But the struts will ask some structures like this.
>
>              Root
>
>                         WEB-INF
>
>                                     Classes
>
>                                     Jsp
>
>                                     Lib
>
>                                     Session
>
>                                     (JSP pages)
>
>                         META-INF
>

I am not sure whether the tabbing in the diagram above is correct or not, but
JSP pages in the struts example application, as well as most other web apps, are
under the directory you have labelled "Root", rather than being inside the
WEB-INF directory.

>
> The question comes down is, we want to use struts in our system, but we don'
> t want to change our system structures. I recognize the struts pickup the
> web.xml like default configuration files from WEB-INF directory, and
> hardcode action.xml in action.java. If anybody has similar condition like
> this, please help.
>

You might want to review the servlet specification, version 2.2, which you can
download from <http://java.sun.com/products/servlet/download.html>.  This
document dictates the organization of files within a web application, and it's
done this way for some very good reasons.

For many of the Struts-specific issues related to file location (such as where
the "action.xml" file is found), there are usually initialization parameters for
the controller servlet that you can customize.  However, you will generally want
to keep configuration files under the WEB-INF directory, because the servlet
container is not allowed to serve these files directly to clients.  If you put
"action.xml" under the root directory, for example, a user could type:

    http://www.yourcompany.com/yourapp/action.xml

and learn a lot of sensitive things about how your application is organized.

>
> I really looking forward to use this MVC structure in our software.
>
> Thanks

Craig McClanahan


Reply via email to