You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ashish Kulkarni <ku...@yahoo.com> on 2003/03/14 22:57:11 UTC

[OT]servlet filter problem

Hi,
Tomcat 4.1.12
I have the following definition in my web.xml, but
some how it is not working...
I want to filter all the request which go to 
/pages/planning/*.do
How do i do it??
<filter>
      <filter-name>MapsValidFilter</filter-name>

     
<filter-class>com.pfizer.maps.common.MapsValidFilter</filter-class>
   </filter>

   <filter-mapping>
      <filter-name>MapsValidFilter</filter-name>

      <url-pattern>/pages/planning/*.do</url-pattern>
   </filter-mapping>


=====
A$HI$H

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

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


Re: Basic Doubt Regarding Initialization of ActionForm when invoked a jsp page

Posted by Dan Allen <da...@mojavelinux.com>.
>     I have a basic doubt regarding initilization of ActionForm in an
> application.
> 
> Example:
> 
> I have a login.jsp.
> In login.jsp I have <html:form action="login.go">
> 
> For this action I configuration Action and ActionForm classes.
> 
> I configured servlet-mappings:
> 
>   <!-- Standard Action Servlet Mapping -->
>   <servlet-mapping>
>     <servlet-name>action</servlet-name>
>     <url-pattern>*.go</url-pattern>
>   </servlet-mapping>
> 
> 
> How the ActionForm initilizes if i called login.jsp directly in browser
> (http://localhost:8080/myApp/login.jsp)
> 
> I think the above request won't go through ActionServlet. I think
> ActionServlet will initilizes the ActionForm.
> 
> When this ActionServlet intilizes the ActionForm? While form submits or
> while loading login.jsp.
> 
> If it loads while loading login.jsp how the ActionServlet initialized
> ActionForm.

Ah, the very same question I started this list with.  When you
request a *.jsp directly, the ActionServlet never get's called at
all.  However, the <html:form> tag will bend over backwards using
RequestUtils to create a new form-bean if one does not already
exist, hence using a backdoor into the struts configuration file
(which is read into memory when the application is started).  Most
people around here shun using direct access to *.jsp files unless it
is a coverpage, and even then they go with a redirect to an action.

So no, ActionServlet plays no part in that request, but thanks to
the Struts taglib, access is still gained to the mapping
confirguartion from web.xml and struts-config.xml

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <da...@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
[Frodo]: "He deserves death." 
[Gandalf]: "Deserves it! I daresay he does. Many that live 
deserve death. And some that die deserve life.  Can you give 
it to them?  Then do not be too eager to deal out death in 
judgement. For even the very wise cannot see all ends."
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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


Basic Doubt Regarding Initialization of ActionForm when invoked a jsp page

Posted by ashokd <as...@visualsoft-tech.com>.
Dear ALL,


    I have a basic doubt regarding initilization of ActionForm in an
application.

Example:

I have a login.jsp.
In login.jsp I have <html:form action="login.go">

For this action I configuration Action and ActionForm classes.

I configured servlet-mappings:

  <!-- Standard Action Servlet Mapping -->
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.go</url-pattern>
  </servlet-mapping>


How the ActionForm initilizes if i called login.jsp directly in browser
(http://localhost:8080/myApp/login.jsp)

I think the above request won't go through ActionServlet. I think
ActionServlet will initilizes the ActionForm.

When this ActionServlet intilizes the ActionForm? While form submits or
while loading login.jsp.

If it loads while loading login.jsp how the ActionServlet initialized
ActionForm.



Thanks in Advance,
Ashok.D




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


Re: [OT]servlet filter problem

Posted by "Craig R. McClanahan" <cr...@apache.org>.
The URL pattern parameter is not a general-purpose regular expression;
only certain patterns are valid.  In particular, if you want to do
extension mapping you have to use "*.do" (which will catch all requests
that have this extension on the end).

Inside your filter, you can be smart about deciding whether a particular
request URI is really one you want to play with, or if you should just
pass it on unmodified.

Craig

On Fri, 14 Mar 2003, Ashish Kulkarni wrote:

> Date: Fri, 14 Mar 2003 13:57:11 -0800 (PST)
> From: Ashish Kulkarni <ku...@yahoo.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: [OT]servlet filter problem
>
> Hi,
> Tomcat 4.1.12
> I have the following definition in my web.xml, but
> some how it is not working...
> I want to filter all the request which go to
> /pages/planning/*.do
> How do i do it??
> <filter>
>       <filter-name>MapsValidFilter</filter-name>
>
>
> <filter-class>com.pfizer.maps.common.MapsValidFilter</filter-class>
>    </filter>
>
>    <filter-mapping>
>       <filter-name>MapsValidFilter</filter-name>
>
>       <url-pattern>/pages/planning/*.do</url-pattern>
>    </filter-mapping>
>
>
> =====
> A$HI$H
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online
> http://webhosting.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

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