Sorry, you have to cast the ServletRequest into an HttpServletRequest, like so:

> doFilter(final ServletRequest req, final ServletResponse res, FilterChain
> chain){

    // cast the ServletRequest into an HttpServletRequest
     HttpServletRequest request = (HttpServletRequest)req;
> 
>     String reqURL = request.getRequestURL.toString();
> 
>   // Need we invoke the BallViewer?
>     if(reqURL.trim().endsWith("/")){
>         
>     }
> 
> }

--- Garrett Smith <[EMAIL PROTECTED]> wrote:
> Did you try a servlet mapping?
> 
> Here, maybe like so:
> 
>       <servlet>
>               <servlet-name>view</servlet-name>
>               <display-name>view</display-name>
>               <description>
>                       A picture of my hairy balls.
>               </description>
>               <servlet-class>org.foo.BallViewer</servlet-class>
>       </servlet>
> 
>       <servlet-mapping>
>               <servlet-name>view</servlet-name>
>               <url-pattern>*/</url-pattern>
>       </servlet-mapping> 
> 
> 
> <welcome-file-list>
>         <welcome-file>/view</welcome-file>
>     </welcome-file-list>
> 
> I've never used the pattern */, but it should work.
> 
> If that doesn't work, you can use a filter. Implement the Filter interface. 
> 
> 
> doFilter(ServletRequest request, ServletResponse response, FilterChain
> chain){
> 
>     String reqURL = request.getRequestURL.toString();
> 
>   // Need we invoke the BallViewer?
>     if(reqURL.trim().endsWith("/")){
>         
>     }
> 
> }
> 
> Implementing a filter will ultimately give you the most power.
> 
> Garrett
> 
> --- Rajkumar Sen <[EMAIL PROTECTED]> wrote:
> > Hello
> >      How do I make a servlet to be the default file rather than
> > the index.jsp file??Basically I want to use the servlet to act as a proxy.
> > I tried modifying the welcome list in web.xml file ,replacing index.jsp by
> > servletname.class but the browser asks the user to download the .class
> > file instead of displaying it??
> > 
> > Rajkumar Sen
> > MTech 1 CSE
> > IIT Bombay
> > 
> > www.cse.iitb.ac.in/~rajkumar
> > (best viewed in Netscape)
> > 
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:tomcat-user-help@;jakarta.apache.org>
> > 
> 
> 
> =====
> http://dhtmlkitchen.com/
> JSP | Servlets | DHTML 
> 
> Garrett Needs A Job
> 
> __________________________________________________
> Do you Yahoo!?
> U2 on LAUNCH - Exclusive greatest hits videos
> http://launch.yahoo.com/u2
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-help@;jakarta.apache.org>
> 


=====
http://dhtmlkitchen.com/
JSP | Servlets | DHTML 

Garrett Needs A Job

__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

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

Reply via email to