tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From R A <java2des...@yahoo.com>
Subject Re: WebSphere suuports servlets in </welcome-file> does Tomcat?
Date Thu, 22 Jul 2004 02:29:55 GMT
Here is a copy of my web.xml. I am using struts 1.1 and using an action(index.do) in the <welcome-file/>.
This should be ok, since every request goes through the ActionServlet. When I point to the
web app via a browser, it displays a directory listin; however, when I type index.do on the
url, it executes index.do and maps to the correct jsp.
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app 
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <display-name>Default</display-name>
  <description>Default name</description>
  <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>com.wne.WNEActionServlet</servlet-class>        
        <init-param>
            <param-name>config</param-name>
            <param-value>/WEB-INF/struts-config.xml</param-value>
        </init-param>
        <init-param>
            <param-name>definitions-debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <init-param>
            <param-name>definitions-parser-details</param-name>
            <param-value>0</param-value>
        </init-param>
 <init-param>
            <param-name>definitions-parser-validate</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>listings</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
      <servlet-name>action</servlet-name>
      <url-pattern>*.do</url-pattern>
    </servlet-mapping>
  <session-config>
    <session-timeout>30</session-timeout>
  </session-config>
   <!-- The Welcome File List -->
  <welcome-file-list>
    <welcome-file>index.do</welcome-file>
  </welcome-file-list>
    <taglib>
      <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
      <taglib-location>/WEB-INF/lib/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
      <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
      <taglib-location>/WEB-INF/lib/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
      <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
      <taglib-location>/WEB-INF/lib/struts-tiles.tld</taglib-location>
    </taglib>
    <taglib>
      <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
      <taglib-location>/WEB-INF/lib/struts-logic.tld</taglib-location>
    </taglib>
    
    <security-constraint>
      <display-name>Example Security Constraint</display-name>
      <web-resource-collection>
         <web-resource-name>Protected Area</web-resource-name>
  <!-- Define the context-relative URL(s) to be protected -->
         <url-pattern>/jsp/security/protected/*</url-pattern>
  <!-- If you list http methods, only those methods are protected -->
  <http-method>DELETE</http-method>
         <http-method>GET</http-method>
         <http-method>POST</http-method>
  <http-method>PUT</http-method>
      </web-resource-collection>
      <auth-constraint>
         <!-- Anyone with one of the listed roles may access this area -->
         <role-name>tomcat</role-name>
  <role-name>role1</role-name>
      </auth-constraint>
    </security-constraint>
    <!-- Default login configuration uses form-based authentication -->
    <login-config>
      <auth-method>FORM</auth-method>
      <realm-name>Example Form-Based Authentication Area</realm-name>
      <form-login-config>
        <form-login-page>/jsp/security/protected/login.jsp</form-login-page>
        <form-error-page>/jsp/security/protected/error.jsp</form-error-page>
      </form-login-config>
    </login-config>
    <!-- Security roles referenced by this web application -->
    <security-role>
      <role-name>role1</role-name>
    </security-role>
    <security-role>
      <role-name>tomcat</role-name>
    </security-role>
    <!-- Environment entry examples -->
    <!--env-entry>
      <env-entry-description>
         The maximum number of tax exemptions allowed to be set.
      </env-entry-description>
      <env-entry-name>maxExemptions</env-entry-name>
      <env-entry-value>15</env-entry-value>
      <env-entry-type>java.lang.Integer</env-entry-type>
    </env-entry-->
    <env-entry>
      <env-entry-name>minExemptions</env-entry-name>
      <env-entry-value>1</env-entry-value>
      <env-entry-type>java.lang.Integer</env-entry-type>
    </env-entry>
    <env-entry>
      <env-entry-name>foo/name1</env-entry-name>
      <env-entry-value>value1</env-entry-value>
      <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    <env-entry>
      <env-entry-name>foo/bar/name2</env-entry-name>
      <env-entry-value>true</env-entry-value>
      <env-entry-type>java.lang.Boolean</env-entry-type>
    </env-entry>
    <env-entry>
      <env-entry-name>name3</env-entry-name>
      <env-entry-value>1</env-entry-value>
      <env-entry-type>java.lang.Integer</env-entry-type>
    </env-entry>
    <env-entry>
      <env-entry-name>foo/name4</env-entry-name>
      <env-entry-value>10</env-entry-value>
      <env-entry-type>java.lang.Integer</env-entry-type>
    </env-entry>
    
</web-app>


Tim Funk <funkman@joedog.org> wrote:
Yes. post your web.xml and maybe someone can help.

R A wrote:
> Have you tried it? I can not get it to work. If I type the action via the URL it appears.
However, when I add it to the welcome-list and point a browser to the web-app, Tomcat returns
a directory listing. Any ideas?
> 
> Tim Funk wrote:
> Tomcat 5 does because the 2.4 spec says so.
> 
> Tomcat 4.X does not.
> 
> -Tim
> 
> R A wrote:
> 
> 
>>When entering a servlet(action) in the tag, Tomcat returns a directory listing. Does
it support servlets in the tags?


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



		
---------------------------------
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message